struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr38236.c
blob554026b1ce4be6175e8485603905ad9e6a233a8d
1 /*
2 pr15262.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 struct X { int i; };
13 int
14 foo (struct X *p, int *q, int a, int b)
16 struct X x, y;
17 if (a)
18 p = &x;
19 if (b)
20 q = &x.i;
21 else
22 q = &y.i;
23 *q = 1;
24 return p->i;
27 void
28 testTortureExecute (void)
30 if (foo((void *)0, (void *)0, 1, 1) != 1)
31 ASSERT (0);
32 return;