struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20100316-1.c
blobcb800fb720f62483c67c37165f0d5bd11d103944
1 /*
2 20100316-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 #ifndef __SDCC_pic16 // TODO: enable when the pic16 ports supports bitfields of size greater than 8 bits!
12 struct Foo {
13 int i;
14 unsigned precision : 10;
15 unsigned blah : 3;
16 } f;
18 int
19 foo (struct Foo *p)
21 struct Foo *q = p;
22 return (*q).precision;
24 #endif
26 void
27 testTortureExecute (void)
29 #ifndef __SDCC_pic16
30 f.i = -1;
31 f.precision = 0;
32 f.blah = -1;
33 if (foo (&f) != 0)
34 ASSERT (0);
35 return;
36 #endif