1 /* Test for MS structure sizes. */
2 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
3 /* { dg-require-effective-target ilp32 } */
4 /* { dg-options "-std=gnu99" } */
8 #define ATTR __attribute__((__ms_struct__))
10 #define size_struct_0 1
11 #define size_struct_1 4
12 #define size_struct_2 24
13 #define size_struct_3 8
14 #define size_struct_4 32
15 #define size_struct_5 12
16 #define size_struct_6 40
17 #define size_struct_7 8
18 #define size_struct_8 20
19 #define size_struct_9 32
25 typedef struct _struct_0 struct_0
;
32 typedef struct _struct_1 struct_1
;
37 unsigned char member_1
:8;
39 unsigned char member_3
:5;
44 typedef struct _struct_2 struct_2
;
48 unsigned long member_0
:26;
49 unsigned char member_1
:2;
52 typedef struct _struct_3 struct_3
;
56 unsigned char member_0
:7;
63 typedef struct _struct_4 struct_4
;
67 unsigned short member_0
:12;
69 unsigned short member_2
:6;
72 typedef struct _struct_5 struct_5
;
76 unsigned char member_0
:7;
77 unsigned long member_1
:25;
84 typedef struct _struct_6 struct_6
;
91 typedef struct _struct_7 struct_7
;
95 unsigned char member_0
:7;
100 unsigned short member_5
:4;
101 unsigned char member_6
:3;
105 typedef struct _struct_8 struct_8
;
110 unsigned long member_1
:6;
113 unsigned long member_4
:22;
116 typedef struct _struct_9 struct_9
;
118 struct_0 test_struct_0
= { 123 };
119 struct_1 test_struct_1
= { 82, 1081 };
120 struct_2 test_struct_2
= { 20.0, 31, 407760, 1, 14916, 6712 };
121 struct_3 test_struct_3
= { 64616999, 1 };
122 struct_4 test_struct_4
= { 61, 20.0, 20.0, 12, 0 };
123 struct_5 test_struct_5
= { 909, 1, 57 };
124 struct_6 test_struct_6
= { 12, 21355796, 0, 20.0, 467, 20.0 };
125 struct_7 test_struct_7
= { 20.0 };
126 struct_8 test_struct_8
= { 126, 1821, 22, 125, 6, 0, 2432638 };
127 struct_9 test_struct_9
= { 20.0, 3, 23957, 20.0, 1001631 };
134 if (size_struct_0
!= sizeof (struct_0
))
137 if (size_struct_1
!= sizeof (struct_1
))
140 if (size_struct_2
!= sizeof (struct_2
))
143 if (size_struct_3
!= sizeof (struct_3
))
146 if (size_struct_4
!= sizeof (struct_4
))
149 if (size_struct_5
!= sizeof (struct_5
))
152 if (size_struct_6
!= sizeof (struct_6
))
155 if (size_struct_7
!= sizeof (struct_7
))
158 if (size_struct_8
!= sizeof (struct_8
))
161 if (size_struct_9
!= sizeof (struct_9
))