]> granicus.if.org Git - clang/blob - test/CodeGen/struct-x86-darwin.c
pull .ll and .bc writing out of the ASTConsumer destructors into some top
[clang] / test / CodeGen / struct-x86-darwin.c
1 // RUN: clang < %s -emit-llvm > %t1
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 &&
7 // RUN: grep "STestB3 = type { i8, i8 }" %t1 &&
8 // RUN: grep "STestB4 = type { i8, i8, i8, i8 }" %t1
9 // RUN: grep "STestB5 = type { i8, i8, i8, i8, i8, i8 }" %t1
10 // RUN: grep "STestB6 = type { i8, i8, i8, i8 }" %t1
11 // Test struct layout for x86-darwin target
12 // FIXME : Enable this test for x86-darwin only. At the moment clang hard codes
13 // x86-darwin as the target
14
15 struct STest1 {int x; short y[4]; double z; } st1;
16 struct STest2 {short a,b; int c,d; } st2;
17 struct STest3 {char a; short b; int c; } st3;
18
19 // Bitfields 
20 struct STestB1 {char a; char b:2; } stb1;
21 struct STestB2 {char a; char b:5; char c:4; } stb2;
22 struct STestB3 {char a; char b:2; } stb3;
23 struct STestB4 {char a; short b:2; char c; } stb4;
24 struct STestB5 {char a; short b:10; char c; } stb5;
25 struct STestB6 {int a:1; char b; int c:13 } stb6;
26
27 // Packed struct STestP1 {char a; short b; int c; } __attribute__((__packed__)) stp1;