Devang Patel | 9889c1a | 2007-11-01 00:07:12 +0000 | [diff] [blame] | 1 | // RUN: clang %s -emit-llvm > %t1 |
Devang Patel | 75027e6 | 2007-12-06 19:16:05 +0000 | [diff] [blame] | 2 | // Run grep "STest1 = type { i32, \[4 x i16\], double }" %t1 && |
| 3 | // RUN: grep "STest2 = type { i16, i16, i32, i32 }" %t1 && |
| 4 | // RUN: grep "STest3 = type { i8, i8, i16, i32 }" %t1 && |
| 5 | // RUN: grep "STestB1 = type { i8, i8 }" %t1 && |
| 6 | // RUN: grep "STestB2 = type { i8, i8, i8 }" %t1 |
Devang Patel | 85efa66 | 2007-10-31 21:02:10 +0000 | [diff] [blame] | 7 | // Test struct layout for x86-darwin target |
| 8 | // FIXME : Enable this test for x86-darwin only. At the moment clang hard codes |
| 9 | // x86-darwin as the target |
| 10 | |
| 11 | struct STest1 {int x; short y[4]; double z; } st1; |
Devang Patel | 9889c1a | 2007-11-01 00:07:12 +0000 | [diff] [blame] | 12 | struct STest2 {short a,b; int c,d; } st2; |
| 13 | struct STest3 {char a; short b; int c; } st3; |
| 14 | |
Devang Patel | 75027e6 | 2007-12-06 19:16:05 +0000 | [diff] [blame] | 15 | // Bitfields |
| 16 | struct STestB1 {char a; char b:2; } stb1; |
| 17 | struct STestB2 {char a; char b:5; char c:4} stb2; |
| 18 | |
| 19 | //struct STestB {int a:1; char b; int c:13 } stb; |
Devang Patel | 9889c1a | 2007-11-01 00:07:12 +0000 | [diff] [blame] | 20 | // Packed struct STestP1 {char a; short b; int c; } __attribute__((__packed__)) stp1; |