xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/struct-x86-darwin.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 < %s -emit-llvm > %t1 -triple=i686-apple-darwin9
2*f4a2713aSLionel Sambuc // RUN: grep "STest1 = type { i32, \[4 x i16\], double }" %t1
3*f4a2713aSLionel Sambuc // RUN: grep "STest2 = type { i16, i16, i32, i32 }" %t1
4*f4a2713aSLionel Sambuc // RUN: grep "STest3 = type { i8, i16, i32 }" %t1
5*f4a2713aSLionel Sambuc // RUN: grep "STestB1 = type { i8, i8 }" %t1
6*f4a2713aSLionel Sambuc // RUN: grep "STestB2 = type { i8, i8, i8 }" %t1
7*f4a2713aSLionel Sambuc // RUN: grep "STestB3 = type { i8, i8 }" %t1
8*f4a2713aSLionel Sambuc // RUN: grep "STestB4 = type { i8, i8, i8, i8 }" %t1
9*f4a2713aSLionel Sambuc // RUN: grep "STestB5 = type { i8, i8, \[2 x i8\], i8, i8 }" %t1
10*f4a2713aSLionel Sambuc // RUN: grep "STestB6 = type { i8, i8, \[2 x i8\] }" %t1
11*f4a2713aSLionel Sambuc // Test struct layout for x86-darwin target
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc struct STest1 {int x; short y[4]; double z; } st1;
14*f4a2713aSLionel Sambuc struct STest2 {short a,b; int c,d; } st2;
15*f4a2713aSLionel Sambuc struct STest3 {char a; short b; int c; } st3;
16*f4a2713aSLionel Sambuc 
17*f4a2713aSLionel Sambuc // Bitfields
18*f4a2713aSLionel Sambuc struct STestB1 {char a; char b:2; } stb1;
19*f4a2713aSLionel Sambuc struct STestB2 {char a; char b:5; char c:4; } stb2;
20*f4a2713aSLionel Sambuc struct STestB3 {char a; char b:2; } stb3;
21*f4a2713aSLionel Sambuc struct STestB4 {char a; short b:2; char c; } stb4;
22*f4a2713aSLionel Sambuc struct STestB5 {char a; short b:10; char c; } stb5;
23*f4a2713aSLionel Sambuc struct STestB6 {int a:1; char b; int c:13 } stb6;
24*f4a2713aSLionel Sambuc 
25*f4a2713aSLionel Sambuc // Packed struct STestP1 {char a; short b; int c; } __attribute__((__packed__)) stp1;
26