1 // RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-apple-darwin9 %s | FileCheck %s
2 // RUN: %clang_cc1 -emit-llvm -o - -triple thumbv7-apple-ios -target-abi apcs-gnu %s | FileCheck %s -check-prefix=CHECK-ARM
4 // Note that we're declaring global variables with these types,
5 // triggering both Sema and IRGen struct layout.
7 #define ATTR __attribute__((__ms_struct__))
16 // CHECK: @s1 ={{.*}} global i32 2
17 // CHECK-ARM: @s1 ={{.*}} global i32 2
28 // CHECK: @s2 ={{.*}} global i32 2
29 // CHECK-ARM: @s2 ={{.*}} global i32 2
42 // CHECK: @s3 ={{.*}} global i32 2
43 // CHECK-ARM: @s3 ={{.*}} global i32 2
51 // CHECK: @s4 ={{.*}} global i32 1
52 // CHECK-ARM: @s4 ={{.*}} global i32 1
62 // CHECK: @s5 ={{.*}} global i32 1
63 // CHECK-ARM: @s5 ={{.*}} global i32 1
73 // CHECK: @s6 ={{.*}} global i32 1
74 // CHECK-ARM: @s6 ={{.*}} global i32 1
94 // CHECK: @s7 ={{.*}} global i32 9
95 // CHECK-ARM: @s7 ={{.*}} global i32 9
104 // CHECK: @s8 ={{.*}} global i32 0
105 // CHECK-ARM: @s8 ={{.*}} global i32 0
137 // CHECK: @s9 ={{.*}} global i32 28
138 // CHECK-ARM: @s9 ={{.*}} global i32 28
146 int s10
= sizeof(t10
);
147 // CHECK: @s10 ={{.*}} global i32 16
148 // CHECK-ARM: @s10 ={{.*}} global i32 8
150 // ensure that ms_structs work correctly on a !useBitFieldTypeAlignment() target
156 int s11
= sizeof(t11
);
157 // CHECK: @s11 ={{.*}} global i32 12
158 // CHECK-ARM: @s11 ={{.*}} global i32 12
163 unsigned short c
: 6;
165 int s12
= sizeof(t12
);
166 // CHECK: @s12 ={{.*}} global i32 4
167 // CHECK-ARM: @s12 ={{.*}} global i32 4
172 __attribute__((packed
)) unsigned short c
: 6;
174 int s13
= sizeof(t13
);
175 // CHECK: @s13 ={{.*}} global i32 4
176 // CHECK-ARM: @s13 ={{.*}} global i32 4