diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-19 22:55:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-19 22:55:41 +0000 |
commit | c1de52de64725945e5ae87e6f99ddedf161856e5 (patch) | |
tree | b990f1f5f7d3218991074f89b15765772a77192c /test/Sema/struct-packed-align.c | |
parent | 3e026e323f1bd820fb9c880b1db951c87df94bb4 (diff) |
Fix PR9253, allowing attribute(aligned) to reduce the alignment of
a typedef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126059 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/struct-packed-align.c')
-rw-r--r-- | test/Sema/struct-packed-align.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Sema/struct-packed-align.c b/test/Sema/struct-packed-align.c index 2b9456703c..6ca6a6096c 100644 --- a/test/Sema/struct-packed-align.c +++ b/test/Sema/struct-packed-align.c @@ -117,3 +117,18 @@ struct packed_fas2 { extern int m1[sizeof(struct packed_fas2) == 1 ? 1 : -1]; extern int m2[__alignof(struct packed_fas2) == 1 ? 1 : -1]; + +// Attribute aligned can round down typedefs. PR9253 +typedef long long __attribute__((aligned(1))) nt; + +struct nS { + char buf_nr; + nt start_lba; +}; + +extern int n1[sizeof(struct nS) == 9 ? 1 : -1]; +extern int n2[__alignof(struct nS) == 1 ? 1 : -1]; + + + + |