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