diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-02-18 20:06:09 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-18 20:06:09 +0000 |
| commit | aac5bf19a57c5ea3a572fc2dac54eba4ad1e24a9 (patch) | |
| tree | 22de0353c59acac7a75b79a59354ac5b83fbebb7 /clang | |
| parent | b1c22fe9b7364ba668bcf0124d3e841695f63551 (diff) | |
| download | bcm5719-llvm-aac5bf19a57c5ea3a572fc2dac54eba4ad1e24a9.tar.gz bcm5719-llvm-aac5bf19a57c5ea3a572fc2dac54eba4ad1e24a9.zip | |
__attribute__((aligned)) was being ignored!
This knocks out another 8 gcc/compat/i386 & x86_64 failures.
llvm-svn: 64947
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 3 | ||||
| -rw-r--r-- | clang/test/Sema/struct-packed-align.c | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index a385d97f680..614e53a751a 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1177,8 +1177,9 @@ static void HandleAlignedAttr(Decl *d, const AttributeList &Attr, Sema &S) { unsigned Align = 0; if (Attr.getNumArgs() == 0) { // FIXME: This should be the target specific maximum alignment. - // (For now we just use 128 bits which is the maximum on X86. + // (For now we just use 128 bits which is the maximum on X86). Align = 128; + d->addAttr(new AlignedAttr(Align)); return; } diff --git a/clang/test/Sema/struct-packed-align.c b/clang/test/Sema/struct-packed-align.c index 8173f0f2827..2b5a889580f 100644 --- a/clang/test/Sema/struct-packed-align.c +++ b/clang/test/Sema/struct-packed-align.c @@ -46,6 +46,14 @@ struct __attribute__((aligned(8))) as1 { extern int e1[sizeof(struct as1) == 8 ? 1 : -1]; extern int e2[__alignof(struct as1) == 8 ? 1 : -1]; +// FIXME: Will need to force arch once max usable alignment isn't hard +// coded. +struct __attribute__((aligned)) as1_2 { + char c; +}; +extern int e1_2[sizeof(struct as1_2) == 16 ? 1 : -1]; +extern int e2_2[__alignof(struct as1_2) == 16 ? 1 : -1]; + struct as2 { char c; int __attribute__((aligned(8))) a; |

