Imported Upstream version 2.9.0
[debian/cc1111] / support / regression / tests / bug-1981238.c
1 /*
2     bug1981238.c
3 */
4 #include <testfwk.h>
5
6 code struct {
7   char x:1;
8   char  :0;
9   char d:2;
10   char b:6;
11 } pad = {1, 2, 1};
12
13 code struct {
14   int p:1;
15   int q:7;
16   char :0;
17   int s:1;
18   int t:7;
19 } noPad = {1, 120, 1, 127};
20
21 code struct {
22   char  :0;
23   char b;
24 } initialNoPad[] = {{2}, {4}};
25
26 void testBitfield (void)
27 {
28   ASSERT (sizeof (pad) == 2);
29   ASSERT (sizeof (noPad) == 2);
30   ASSERT (sizeof (initialNoPad[0]) == 1);
31 }