Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / ms_struct-bitfield-3.c
blob3f6a4de91db3247a9c17531e6b724179c4359cb6
1 // RUN: %clang_cc1 -emit-llvm-only -triple i386-apple-darwin9 %s
3 #define ATTR __attribute__((__ms_struct__))
5 struct _struct_0
7 int member_0 : 25 ;
8 short member_1 : 6 ;
9 char member_2 : 2 ;
10 unsigned short member_3 : 1 ;
11 unsigned char member_4 : 7 ;
12 short member_5 : 16 ;
13 int : 0 ;
14 char member_7 ;
16 } ATTR;
18 typedef struct _struct_0 struct_0;
20 #define size_struct_0 20
22 struct_0 test_struct_0 = { 18557917, 17, 3, 0, 80, 6487, 93 };
23 static int a[(size_struct_0 == sizeof (struct_0)) -1];
25 struct _struct_1 {
26 int d;
27 unsigned char a;
28 unsigned short b:7;
29 char c;
30 } ATTR;
32 typedef struct _struct_1 struct_1;
34 #define size_struct_1 12
36 struct_1 test_struct_1 = { 18557917, 'a', 3, 'b' };
38 static int a1[(size_struct_1 == sizeof (struct_1)) -1];
40 struct ten {
41 long long a:3;
42 long long b:3;
43 char c;
44 } __attribute__ ((ms_struct));
46 #define size_struct_2 16
48 static int a2[(size_struct_2 == sizeof (struct ten)) -1];