struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20030606-1.c
blob0f4fd96dca081f3e8ee4ec3f0a421daf7ecbe7ca
1 /*
2 20030606-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 #include <string.h>
13 int * foo (int *x, int b)
16 *(x++) = 55;
17 if (b)
18 *(x++) = b;
20 return x;
23 void
24 testTortureExecute (void)
26 int a[5];
28 memset (a, 1, sizeof (a));
30 if (foo (a, 0) - a != 1 || a[0] != 55 || a[1] != a[4])
31 ASSERT (0);
33 memset (a, 1, sizeof (a));
35 if (foo (a, 2) - a != 2 || a[0] != 55 || a[1] != 2)
36 ASSERT (0);
38 return;