diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
commit | be1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch) | |
tree | 1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/CodeGen/struct-x86-darwin.c | |
parent | c4626a62754862d20b41e8a46a3574264ea80e6d (diff) | |
parent | f1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff) |
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/CodeGen/struct-x86-darwin.c')
-rw-r--r-- | clang/test/CodeGen/struct-x86-darwin.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/CodeGen/struct-x86-darwin.c b/clang/test/CodeGen/struct-x86-darwin.c new file mode 100644 index 0000000..afdcb8a --- /dev/null +++ b/clang/test/CodeGen/struct-x86-darwin.c @@ -0,0 +1,25 @@ +// RUN: %clang_cc1 < %s -emit-llvm > %t1 -triple=i686-apple-darwin9 +// RUN: grep "STest1 = type { i32, \[4 x i16\], double }" %t1 +// RUN: grep "STest2 = type { i16, i16, i32, i32 }" %t1 +// RUN: grep "STest3 = type { i8, i16, i32 }" %t1 +// RUN: grep "STestB1 = type { i8, i8 }" %t1 +// RUN: grep "STestB2 = type { i8, i8, i8 }" %t1 +// RUN: grep "STestB3 = type { i8, i8 }" %t1 +// RUN: grep "STestB4 = type { i8, i8, i8, i8 }" %t1 +// RUN: grep "STestB5 = type { i8, i8, \[2 x i8\], i8, i8 }" %t1 +// RUN: grep "STestB6 = type { i8, i8, \[2 x i8\] }" %t1 +// Test struct layout for x86-darwin target + +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 {char a; char b:2; } stb1; +struct STestB2 {char a; char b:5; char c:4; } stb2; +struct STestB3 {char a; char b:2; } stb3; +struct STestB4 {char a; short b:2; char c; } stb4; +struct STestB5 {char a; short b:10; char c; } stb5; +struct STestB6 {int a:1; char b; int c:13 } stb6; + +// Packed struct STestP1 {char a; short b; int c; } __attribute__((__packed__)) stp1; |