blob: 0b15a24f0337dd0be08d2168d718df7e7d03e4dc [file] [log] [blame]
Fariborz Jahanianfc0fe6e2011-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
Fariborz Jahanian759e4a12011-05-03 22:07:14 +000046struct
47{
48 char foo : 4;
49 short : 0;
50 long :0;
51 char bar;
52} ATTR t6;
53static int a6[(sizeof(t6) == 4) -1];
54
55struct
56{
57 char foo : 4;
58 long :0;
59 short : 0;
60 char bar;
61} ATTR t7;
62static int a7[(sizeof(t7) == 16) -1];
63
64struct
65{
66 char foo : 4;
67 short : 0;
68 long :0;
69 char bar:7;
70} ATTR t8;
71static int a8[(sizeof(t8) == 4) -1];
72
73struct
74{
75 char foo : 4;
76 long :0;
77 short : 0;
78 char bar: 8;
79} ATTR t9;
80static int a9[(sizeof(t9) == 16) -1];
81
82struct
83{
84 char foo : 4;
85 char : 0;
86 short : 0;
87 int : 0;
88 long :0;
89 char bar;
90} ATTR t10;
91static int a10[(sizeof(t10) == 2) -1];