diff options
Diffstat (limited to 'test/Sema/attr-aligned.c')
-rw-r--r-- | test/Sema/attr-aligned.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/test/Sema/attr-aligned.c b/test/Sema/attr-aligned.c index bcb12ee..c094ff1 100644 --- a/test/Sema/attr-aligned.c +++ b/test/Sema/attr-aligned.c @@ -13,9 +13,26 @@ struct struct_with_ueber_char { ueber_aligned_char c; }; -char c = 0; +char a = 0; char a0[__alignof__(ueber_aligned_char) == 8? 1 : -1] = { 0 }; char a1[__alignof__(struct struct_with_ueber_char) == 8? 1 : -1] = { 0 }; -char a2[__alignof__(c) == 1? : -1] = { 0 }; -char a3[sizeof(c) == 1? : -1] = { 0 }; +char a2[__alignof__(a) == 1? : -1] = { 0 }; +char a3[sizeof(a) == 1? : -1] = { 0 }; + +// rdar://problem/8335865 +int b __attribute__((aligned(2))); +char b1[__alignof__(b) == 2 ?: -1] = {0}; + +struct C { int member __attribute__((aligned(2))); } c; +char c1[__alignof__(c) == 4 ?: -1] = {0}; +char c2[__alignof__(c.member) == 4 ?: -1] = {0}; + +struct D { int member __attribute__((aligned(2))) __attribute__((packed)); } d; +char d1[__alignof__(d) == 2 ?: -1] = {0}; +char d2[__alignof__(d.member) == 2 ?: -1] = {0}; + +struct E { int member __attribute__((aligned(2))); } __attribute__((packed)); +struct E e; +char e1[__alignof__(e) == 2 ?: -1] = {0}; +char e2[__alignof__(e.member) == 2 ?: -1] = {0}; |