diff options
author | Anders Carlsson <andersca@mac.com> | 2010-04-17 21:04:52 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-04-17 21:04:52 +0000 |
commit | 2295f13bb0e5d8f8651152adca3a123d6ce5c472 (patch) | |
tree | f723c2ed509510870e819c3e0e2acbf6da9e4cf0 /clang/test/CodeGenCXX/bitfield-layout.cpp | |
parent | 1de2f5710b25b4e3a09f38e6c521b27755bf644e (diff) | |
download | bcm5719-llvm-2295f13bb0e5d8f8651152adca3a123d6ce5c472.tar.gz bcm5719-llvm-2295f13bb0e5d8f8651152adca3a123d6ce5c472.zip |
Unnamed bit-fields in a union should be laid out with a type that doesn't affect alignment.
llvm-svn: 101673
Diffstat (limited to 'clang/test/CodeGenCXX/bitfield-layout.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/bitfield-layout.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/bitfield-layout.cpp b/clang/test/CodeGenCXX/bitfield-layout.cpp index c77c925d876..94250195f50 100644 --- a/clang/test/CodeGenCXX/bitfield-layout.cpp +++ b/clang/test/CodeGenCXX/bitfield-layout.cpp @@ -1,9 +1,17 @@ // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s -// CHECK: = type { i32, [4 x i8] } +// CHECK: %union.Test1 = type { i32, [4 x i8] } union Test1 { int a; int b: 39; -}; +} t1; -Test1 t1; +// CHECK: %union.Test2 = type { i8 } +union Test2 { + int : 6; +} t2; + +// CHECK: %union.Test3 = type { [2 x i8] } +union Test3 { + int : 9; +} t3; |