1// 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{
8   char foo;
9   long : 0;
10   char bar;
11} ATTR t1;
12
13struct
14{
15   char foo;
16   long : 0;
17   char : 0;
18   int : 0;
19   char bar;
20} ATTR t2;
21
22struct
23{
24   char foo;
25   long : 0;
26   char : 0;
27   int : 0;
28   char bar;
29   long : 0;
30   char : 0;
31} ATTR t3;
32
33struct
34{
35   long : 0;
36   char bar;
37} ATTR t4;
38
39struct
40{
41   long : 0;
42   long : 0;
43   char : 0;
44   char bar;
45} ATTR t5;
46
47struct
48{
49   long : 0;
50   long : 0;
51   char : 0;
52   char bar;
53} ATTR t6;
54
55struct
56{
57   char foo;
58   long : 0;
59   int : 0;
60   char bar;
61   char bar1;
62   long : 0;
63   char bar2;
64   char bar3;
65   char : 0;
66   char bar4;
67   char bar5;
68   char : 0;
69   char bar6;
70   char bar7;
71} ATTR t7;
72
73struct
74{
75   long : 0;
76   long : 0;
77   char : 0;
78} ATTR t8;
79
80struct
81{
82   char foo;
83   long : 0;
84   int : 0;
85   char bar;
86   char bar1;
87   long : 0;
88   char bar2;
89   char bar3;
90   char : 0;
91   char bar4;
92   char bar5;
93   char : 0;
94   char bar6;
95   char bar7;
96   int  i1;
97   char : 0;
98   long : 0;
99   char :4;
100   char bar8;
101   char : 0;
102   char bar9;
103   char bar10;
104   int  i2;
105   char : 0;
106   long : 0;
107   char :4;
108} ATTR t9;
109
110struct
111{
112   char foo: 8;
113   long : 0;
114   char bar;
115} ATTR t10;
116
117static int arr1[(sizeof(t1) == 2) -1];
118static int arr2[(sizeof(t2) == 2) -1];
119static int arr3[(sizeof(t3) == 2) -1];
120static int arr4[(sizeof(t4) == 1) -1];
121static int arr5[(sizeof(t5) == 1) -1];
122static int arr6[(sizeof(t6) == 1) -1];
123static int arr7[(sizeof(t7) == 9) -1];
124static int arr8[(sizeof(t8) == 0) -1];
125static int arr9[(sizeof(t9) == 28) -1];
126static int arr10[(sizeof(t10) == 16) -1];
127
128int main() {
129  return 0;
130}
131
132