blob: 0b26d382e22f192f813d3a02150d6e473ac3a5e1 [file] [log] [blame]
Chad Rosier4ab00242011-08-04 00:19:13 +00001// RUN: %clang_cc1 -target-abi apcs-gnu -triple armv7-apple-darwin10 %s -verify
2
3#include <stddef.h>
4
5struct t1
6{
7 int foo : 1;
8 char : 0;
9 char bar;
10};
11static int arr1_offset[(offsetof(struct t1, bar) == 1) ? 0 : -1];
12static int arr1_sizeof[(sizeof(struct t1) == 2) ? 0 : -1];
13
14struct t2
15{
16 int foo : 1;
17 short : 0;
18 char bar;
19};
20static int arr2_offset[(offsetof(struct t2, bar) == 1) ? 0 : -1];
21static int arr2_sizeof[(sizeof(struct t2) == 2) ? 0 : -1];
22
23struct t3
24{
25 int foo : 1;
26 int : 0;
27 char bar;
28};
29static int arr3_offset[(offsetof(struct t3, bar) == 1) ? 0 : -1];
30static int arr3_sizeof[(sizeof(struct t3) == 2) ? 0 : -1];
31
32struct t4
33{
34 int foo : 1;
35 long : 0;
36 char bar;
37};
38static int arr4_offset[(offsetof(struct t4, bar) == 1) ? 0 : -1];
39static int arr4_sizeof[(sizeof(struct t4) == 2) ? 0 : -1];
40
41struct t5
42{
43 int foo : 1;
44 long long : 0;
45 char bar;
46};
47static int arr5_offset[(offsetof(struct t5, bar) == 1) ? 0 : -1];
48static int arr5_sizeof[(sizeof(struct t5) == 2) ? 0 : -1];
49
50struct t6
51{
52 int foo : 1;
53 char : 0;
54 char bar : 1;
55 char bar2;
56};
57static int arr6_offset[(offsetof(struct t6, bar2) == 1) ? 0 : -1];
58static int arr6_sizeof[(sizeof(struct t6) == 2) ? 0 : -1];
59
60struct t7
61{
62 int foo : 1;
63 short : 0;
64 char bar1 : 1;
65 char bar2;
66};
67static int arr7_offset[(offsetof(struct t7, bar2) == 1) ? 0 : -1];
68static int arr7_sizeof[(sizeof(struct t7) == 2) ? 0 : -1];
69
70struct t8
71{
72 int foo : 1;
73 int : 0;
74 char bar1 : 1;
75 char bar2;
76};
77static int arr8_offset[(offsetof(struct t8, bar2) == 1) ? 0 : -1];
78static int arr8_sizeof[(sizeof(struct t8) == 2) ? 0 : -1];
79
80struct t9
81{
82 int foo : 1;
83 long : 0;
84 char bar1 : 1;
85 char bar2;
86};
87static int arr9_offset[(offsetof(struct t9, bar2) == 1) ? 0 : -1];
88static int arr9_sizeof[(sizeof(struct t9) == 2) ? 0 : -1];
89
90struct t10
91{
92 int foo : 1;
93 long long : 0;
94 char bar1 : 1;
95 char bar2;
96};
97static int arr10_offset[(offsetof(struct t10, bar2) == 1) ? 0 : -1];
98static int arr10_sizeof[(sizeof(struct t10) == 2) ? 0 : -1];
99
100
101struct t11
102{
103 int foo : 1;
104 long long : 0;
105 char : 0;
106 char bar1 : 1;
107 char bar2;
108};
109static int arr11_offset[(offsetof(struct t11, bar2) == 1) ? 0 : -1];
110static int arr11_sizeof[(sizeof(struct t11) == 2) ? 0 : -1];
111
112int main() {
113 return 0;
114}
115