2008-05-29 18:58:49 +08:00
|
|
|
// RUN: clang < %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, 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 &&
|
2008-06-12 20:40:02 +08:00
|
|
|
// RUN: grep "STestB4 = type <{ i8, i8, i8, i8 }>" %t1 &&
|
|
|
|
// RUN: grep "STestB5 = type <{ i8, i8, i8, i8, i8, i8 }>" %t1 &&
|
2008-05-29 18:58:49 +08:00
|
|
|
// RUN: grep "STestB6 = type <{ i8, i8, i8, i8 }>" %t1
|
2007-11-01 05:02:10 +08:00
|
|
|
// Test struct layout for x86-darwin target
|
|
|
|
|
|
|
|
struct STest1 {int x; short y[4]; double z; } st1;
|
2007-11-01 08:07:12 +08:00
|
|
|
struct STest2 {short a,b; int c,d; } st2;
|
|
|
|
struct STest3 {char a; short b; int c; } st3;
|
|
|
|
|
2007-12-07 03:16:05 +08:00
|
|
|
// Bitfields
|
|
|
|
struct STestB1 {char a; char b:2; } stb1;
|
2007-12-11 08:49:18 +08:00
|
|
|
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;
|
2008-01-22 06:54:57 +08:00
|
|
|
struct STestB5 {char a; short b:10; char c; } stb5;
|
|
|
|
struct STestB6 {int a:1; char b; int c:13 } stb6;
|
2007-12-07 03:16:05 +08:00
|
|
|
|
2007-11-01 08:07:12 +08:00
|
|
|
// Packed struct STestP1 {char a; short b; int c; } __attribute__((__packed__)) stp1;
|