summaryrefslogtreecommitdiff
path: root/test/regression/attribs1.c
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-05-12 09:41:09 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-05-12 09:41:09 +0000
commitfe8baff11737d3785ff51d20ace9ab31665cd295 (patch)
treeedbab0f933283d5ecf455a5f94150c4f09379c51 /test/regression/attribs1.c
parent239cbd2ebab8814b11d7ef43c35a17ce56a7ba0b (diff)
cparser: support for attributes over struct and union.
cparser: added experimental emulation of packed structs (PackedStruct.ml) git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1650 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
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;
}
-
-
-