summaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/ms_struct-bitfield.c
blob: a8f4c91a49370b3c8d4040b7378bd0847fa94170 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// RUN: %clang_cc1 -emit-llvm-only  -triple x86_64-apple-darwin9 %s
// rdar://8823265

#define ATTR __attribute__((__ms_struct__))

struct
{
   char foo;
   long : 0;
   char bar;
} ATTR t1;

struct
{
   char foo;
   long : 0;
   char : 0;
   int : 0;
   char bar;
} ATTR t2;

struct
{
   char foo;
   long : 0;
   char : 0;
   int : 0;
   char bar;
   long : 0;
   char : 0;
} ATTR t3;

struct
{
   long : 0;
   char bar;
} ATTR t4;

struct
{
   long : 0;
   long : 0;
   char : 0;
   char bar;
} ATTR t5;

struct
{
   long : 0;
   long : 0;
   char : 0;
   char bar;
} ATTR t6;

struct
{
   char foo;
   long : 0;
   int : 0;
   char bar;
   char bar1;
   long : 0;
   char bar2;
   char bar3;
   char : 0;
   char bar4;
   char bar5;
   char : 0;
   char bar6;
   char bar7;
} ATTR t7;

struct
{
   long : 0;
   long : 0;
   char : 0;
} ATTR t8;

struct
{
   char foo;
   long : 0;
   int : 0;
   char bar;
   char bar1;
   long : 0;
   char bar2;
   char bar3;
   char : 0;
   char bar4;
   char bar5;
   char : 0;
   char bar6;
   char bar7;
   int  i1;
   char : 0;
   long : 0;
   char :4;
   char bar8;
   char : 0;
   char bar9;
   char bar10;
   int  i2;
   char : 0;
   long : 0;
   char :4;
} ATTR t9;

struct
{
   char foo: 8;
   long : 0;
   char bar;
} ATTR t10;

static int arr1[(sizeof(t1) == 2) -1];
static int arr2[(sizeof(t2) == 2) -1];
static int arr3[(sizeof(t3) == 2) -1];
static int arr4[(sizeof(t4) == 1) -1];
static int arr5[(sizeof(t5) == 1) -1];
static int arr6[(sizeof(t6) == 1) -1];
static int arr7[(sizeof(t7) == 9) -1];
static int arr8[(sizeof(t8) == 0) -1];
static int arr9[(sizeof(t9) == 28) -1];
static int arr10[(sizeof(t10) == 16) -1];

int main() {
  return 0;
}