summaryrefslogtreecommitdiff
path: root/test/regression/attribs1.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/regression/attribs1.c')
-rw-r--r--test/regression/attribs1.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/regression/attribs1.c b/test/regression/attribs1.c
index a02f718..b6e5c22 100644
--- a/test/regression/attribs1.c
+++ b/test/regression/attribs1.c
@@ -24,6 +24,16 @@ __attribute((__section__("myconst"))) const int f = 34;
__attribute((__section__("mycode"))) int myfunc(int x) { return x + 1; }
+/* Alignment with typedefs and structs */
+
+struct __attribute((__aligned__(8))) mystruct { char c1, c2; };
+char filler5 = 1;
+struct mystruct u;
+
+typedef __attribute((__aligned__(8))) int myint;
+char filler6 = 1;
+myint v;
+
/* Test harness */
int main()
@@ -32,8 +42,8 @@ int main()
printf("Address of b = %u mod 8\n", ((unsigned int) &b) & 0x7);
printf("Delta d - c = %u\n", ((unsigned int) &d) - ((unsigned int) &c));
printf("Delta f - e = %u\n", ((unsigned int) &f) - ((unsigned int) &e));
+ printf("Address of u = %u mod 8\n", ((unsigned int) &u) & 0x7);
+ printf("Address of v = %u mod 8\n", ((unsigned int) &v) & 0x7);
+
return 0;
}
-
-
-