blob: 0eba4359145e48057adfb085f3e4e7e948e35fb4 [file] [log] [blame]
Fariborz Jahanian30364d02011-05-09 22:03:17 +00001// RUN: %clang_cc1 -emit-llvm-only -triple i386-apple-darwin9 %s
Fariborz Jahanian52bbe7a2011-05-06 21:56:12 +00002// rdar://8823265
3
4#define ATTR __attribute__((__ms_struct__))
5
6struct _struct_0
7{
8 int member_0 : 25 ;
9 short member_1 : 6 ;
10 char member_2 : 2 ;
11 unsigned short member_3 : 1 ;
12 unsigned char member_4 : 7 ;
13 short member_5 : 16 ;
14 int : 0 ;
15 char member_7 ;
16
17} ATTR;
18
19typedef struct _struct_0 struct_0;
20
21#define size_struct_0 20
22
23struct_0 test_struct_0 = { 18557917, 17, 3, 0, 80, 6487, 93 };
24static int a[(size_struct_0 == sizeof (struct_0)) -1];
Fariborz Jahanian31e7f222011-05-06 22:42:22 +000025
26struct _struct_1 {
27 int d;
28 unsigned char a;
29 unsigned short b:7;
30 char c;
31} ATTR;
32
33typedef struct _struct_1 struct_1;
34
35#define size_struct_1 12
36
37struct_1 test_struct_1 = { 18557917, 'a', 3, 'b' };
38
39static int a1[(size_struct_1 == sizeof (struct_1)) -1];
Fariborz Jahanian30364d02011-05-09 22:03:17 +000040
41struct ten {
42 long long a:3;
43 long long b:3;
44 char c;
45} __attribute__ ((ms_struct));
46
47#define size_struct_2 16
48
49static int a2[(size_struct_2 == sizeof (struct ten)) -1];