struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-930718-1.c
blobdcaa14bab41c47de67a688e5add95ffbe2a2a8e7
1 /*
2 930718-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 typedef struct rtx_def
13 int f1 :1;
14 int f2 :1;
15 } *rtx;
17 static rtx
18 f (register rtx orig)
20 if (orig->f1 || orig->f2)
21 return orig;
22 orig->f2 = 1;
23 return orig;
26 void
27 f2 ()
29 ASSERT (0);
32 void
33 testTortureExecute (void)
35 struct rtx_def foo;
36 rtx bar;
38 foo.f1 = 1;
39 foo.f2 = 0;
40 bar = f (&foo);
41 if (bar != &foo || bar->f2 != 0)
42 ASSERT (0);
43 return;