diff options
author | Devang Patel <dpatel@apple.com> | 2007-12-06 19:16:05 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-12-06 19:16:05 +0000 |
commit | 65a2288eef33bd2bf20d71442b965ae6e5fabead (patch) | |
tree | e2d1063a90c2c920bfbd09d954a9a4d9ddba82fe /clang/test/CodeGen/struct-x86-darwin.c | |
parent | 5eff4de9c8b1a6c9e921a2ebc79ec24eb82460c1 (diff) | |
download | bcm5719-llvm-65a2288eef33bd2bf20d71442b965ae6e5fabead.tar.gz bcm5719-llvm-65a2288eef33bd2bf20d71442b965ae6e5fabead.zip |
More struct bitfields layout work. Now handle,
struct STestB1 {char a; char b:2; } stb1;
struct STestB2 {char a; char b:5; char c:4} stb2;
llvm-svn: 44664
Diffstat (limited to 'clang/test/CodeGen/struct-x86-darwin.c')
-rw-r--r-- | clang/test/CodeGen/struct-x86-darwin.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/test/CodeGen/struct-x86-darwin.c b/clang/test/CodeGen/struct-x86-darwin.c index f7c4bf5021a..1e34a955fd5 100644 --- a/clang/test/CodeGen/struct-x86-darwin.c +++ b/clang/test/CodeGen/struct-x86-darwin.c @@ -1,7 +1,9 @@ // RUN: clang %s -emit-llvm > %t1 -// RUN grep "STest1 = type { i32, \[4 x i16\], double }" %t1 -// RUN: grep "STest2 = type { i16, i16, i32, i32 }" %t1 -// RUN: grep "STest3 = type { i8, i8, i16, i32 }" %t1 +// Run grep "STest1 = type { i32, \[4 x i16\], double }" %t1 && +// RUN: grep "STest2 = type { i16, i16, i32, i32 }" %t1 && +// RUN: grep "STest3 = type { i8, i8, i16, i32 }" %t1 && +// RUN: grep "STestB1 = type { i8, i8 }" %t1 && +// RUN: grep "STestB2 = type { i8, i8, i8 }" %t1 // Test struct layout for x86-darwin target // FIXME : Enable this test for x86-darwin only. At the moment clang hard codes // x86-darwin as the target @@ -10,5 +12,9 @@ struct STest1 {int x; short y[4]; double z; } st1; struct STest2 {short a,b; int c,d; } st2; struct STest3 {char a; short b; int c; } st3; -// Bitfields struct STestB1 {int a:1; char b; int c:13 } stb1; +// Bitfields +struct STestB1 {char a; char b:2; } stb1; +struct STestB2 {char a; char b:5; char c:4} stb2; + +//struct STestB {int a:1; char b; int c:13 } stb; // Packed struct STestP1 {char a; short b; int c; } __attribute__((__packed__)) stp1; |