diff options
| author | Chad Rosier <mcrosier@apple.com> | 2012-03-21 20:20:47 +0000 |
|---|---|---|
| committer | Chad Rosier <mcrosier@apple.com> | 2012-03-21 20:20:47 +0000 |
| commit | b57321ad3d89b9886730c8a2d75a81c8ca13ef79 (patch) | |
| tree | d7125f3008608de5ca74d672db090d6b21c6a9af | |
| parent | 1b12e5ea361b7b60617294b1ebaf4a5f2de4dd04 (diff) | |
| download | bcm5719-llvm-b57321ad3d89b9886730c8a2d75a81c8ca13ef79.tar.gz bcm5719-llvm-b57321ad3d89b9886730c8a2d75a81c8ca13ef79.zip | |
Report the natural alignment of unsigned long long, not the preferred alignment.
rdar://11054144
llvm-svn: 153216
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 3 | ||||
| -rw-r--r-- | clang/test/Sema/align-x86.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index b7e7850329f..f62418b11aa 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1165,7 +1165,8 @@ unsigned ASTContext::getPreferredTypeAlign(const Type *T) const { if (const ComplexType* CT = T->getAs<ComplexType>()) T = CT->getElementType().getTypePtr(); if (T->isSpecificBuiltinType(BuiltinType::Double) || - T->isSpecificBuiltinType(BuiltinType::LongLong)) + T->isSpecificBuiltinType(BuiltinType::LongLong) || + T->isSpecificBuiltinType(BuiltinType::ULongLong)) return std::max(ABIAlign, (unsigned)getTypeSize(T)); return ABIAlign; diff --git a/clang/test/Sema/align-x86.c b/clang/test/Sema/align-x86.c index 61bd1d33c9d..c6cd7543c21 100644 --- a/clang/test/Sema/align-x86.c +++ b/clang/test/Sema/align-x86.c @@ -9,6 +9,10 @@ long long g2; short chk1[__alignof__(g2) == 8 ? 1 : -1]; short chk2[__alignof__(long long) == 8 ? 1 : -1]; +unsigned long long g5; +short chk1[__alignof__(g5) == 8 ? 1 : -1]; +short chk2[__alignof__(unsigned long long) == 8 ? 1 : -1]; + _Complex double g3; short chk1[__alignof__(g3) == 8 ? 1 : -1]; short chk2[__alignof__(_Complex double) == 8 ? 1 : -1]; |

