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 | d62328e6a0fa933e3a5daaf68e4964031e6c5c5e (patch) | |
tree | d410d84f978d31b2a8b414fb83162eb12bfe91dc /test/CodeGenCXX/bitfield-layout.cpp | |
parent | 86664465bac330871d4a476f68a1d6f7f6f102af (diff) |
Unnamed bit-fields in a union should be laid out with a type that doesn't affect alignment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101673 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/bitfield-layout.cpp')
-rw-r--r-- | test/CodeGenCXX/bitfield-layout.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/CodeGenCXX/bitfield-layout.cpp b/test/CodeGenCXX/bitfield-layout.cpp index c77c925d87..94250195f5 100644 --- a/test/CodeGenCXX/bitfield-layout.cpp +++ b/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; |