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