[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
[llvm-project.git] / clang / test / CodeGen / ms_struct-bitfield-2.c
blob1f7cc9ae8b2597aaf1176fef387f44fa0a7f25ad
1 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-darwin9 %s
3 #define ATTR __attribute__((__ms_struct__))
5 #define size_struct_0 1
6 #define size_struct_1 4
7 #define size_struct_2 24
8 #define size_struct_3 8
9 #define size_struct_4 32
10 #define size_struct_5 12
11 #define size_struct_6 40
12 #define size_struct_7 8
13 #define size_struct_8 20
14 #define size_struct_9 32
16 struct _struct_0
18 char member_0;
19 } ATTR;
20 typedef struct _struct_0 struct_0;
22 struct _struct_1
24 char member_0;
25 short member_1:13;
26 } ATTR;
27 typedef struct _struct_1 struct_1;
29 struct _struct_2
31 double member_0;
32 unsigned char member_1:8;
33 int member_2:32;
34 unsigned char member_3:5;
35 short member_4:14;
36 short member_5:13;
37 unsigned char:0;
38 } ATTR;
39 typedef struct _struct_2 struct_2;
41 struct _struct_3
43 unsigned int member_0:26;
44 unsigned char member_1:2;
46 } ATTR;
47 typedef struct _struct_3 struct_3;
49 struct _struct_4
51 unsigned char member_0:7;
52 double member_1;
53 double member_2;
54 short member_3:5;
55 char member_4:2;
57 } ATTR;
58 typedef struct _struct_4 struct_4;
60 struct _struct_5
62 unsigned short member_0:12;
63 int member_1:1;
64 unsigned short member_2:6;
66 } ATTR;
67 typedef struct _struct_5 struct_5;
69 struct _struct_6
71 unsigned char member_0:7;
72 unsigned int member_1:25;
73 char member_2:1;
74 double member_3;
75 short member_4:9;
76 double member_5;
78 } ATTR;
79 typedef struct _struct_6 struct_6;
81 struct _struct_7
83 double member_0;
85 } ATTR;
86 typedef struct _struct_7 struct_7;
88 struct _struct_8
90 unsigned char member_0:7;
91 int member_1:11;
92 int member_2:5;
93 int:0;
94 char member_4:8;
95 unsigned short member_5:4;
96 unsigned char member_6:3;
97 int member_7:23;
99 } ATTR;
100 typedef struct _struct_8 struct_8;
102 struct _struct_9
104 double member_0;
105 unsigned int member_1:6;
106 int member_2:17;
107 double member_3;
108 unsigned int member_4:22;
110 } ATTR;
111 typedef struct _struct_9 struct_9;
113 struct_0 test_struct_0 = { 123 };
114 struct_1 test_struct_1 = { 82, 1081 };
115 struct_2 test_struct_2 = { 20.0, 31, 407760, 1, 14916, 6712 };
116 struct_3 test_struct_3 = { 64616999, 1 };
117 struct_4 test_struct_4 = { 61, 20.0, 20.0, 12, 0 };
118 struct_5 test_struct_5 = { 909, 1, 57 };
119 struct_6 test_struct_6 = { 12, 21355796, 0, 20.0, 467, 20.0 };
120 struct_7 test_struct_7 = { 20.0 };
121 struct_8 test_struct_8 = { 126, 1821, 22, 125, 6, 0, 2432638 };
122 struct_9 test_struct_9 = { 20.0, 3, 23957, 20.0, 1001631 };
125 static int a0[(sizeof (struct_0) == size_struct_0) -1];
126 static int a1[(sizeof (struct_1) == size_struct_1) -1];
127 static int a2[(sizeof (struct_2) == size_struct_2) -1];
128 static int a3[(sizeof (struct_3) == size_struct_3) -1];
129 static int a4[(sizeof (struct_4) == size_struct_4) -1];
130 static int a5[(sizeof (struct_5) == size_struct_5) -1];
131 static int a6[(sizeof (struct_6) == size_struct_6) -1];
132 static int a7[(sizeof (struct_7) == size_struct_7) -1];
133 static int a8[(sizeof (struct_8) == size_struct_8) -1];
134 static int a9[(sizeof (struct_9) == size_struct_9) -1];