blob: 10c6e2aed35872cea0f8ba45db57b4aa0cd2f211 [file] [log] [blame]
Fariborz Jahanian855a8e72011-05-03 20:21:04 +00001// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-darwin9 %s
2// rdar://8823265
3
4#define ATTR __attribute__((__ms_struct__))
5
6struct {
7 unsigned int bf_1 : 12;
8 unsigned int : 0;
9 unsigned int bf_2 : 12;
10} ATTR t1;
11static int a1[(sizeof(t1) == 8) -1];
12
13struct
14{
15 char foo : 4;
16 short : 0;
17 char bar;
18} ATTR t2;
19static int a2[(sizeof(t2) == 4) -1];
20
21#pragma ms_struct on
22struct
23{
24 char foo : 4;
25 short : 0;
26 char bar;
27} t3;
28#pragma ms_struct off
29static int a3[(sizeof(t3) == 4) -1];
30
31struct
32{
33 char foo : 6;
34 long : 0;
35} ATTR t4;
36static int a4[(sizeof(t4) == 8) -1];
37
38struct
39{
40 char foo : 4;
41 short : 0;
42 char bar : 8;
43} ATTR t5;
44static int a5[(sizeof(t5) == 4) -1];
45