struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-950322-1.c
blob0b92c60369a2e8c4927a762fb7fb0d2566d4bcbc
1 /*
2 950322-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 int
12 f (unsigned char *a)
14 int i, j;
15 int x, y;
17 j = a[1];
18 i = a[0] - j;
19 if (i < 0)
21 x = 1;
22 y = -i;
24 else
26 x = 0;
27 y = i;
29 return x + y;
32 void
33 testTortureExecute (void)
35 unsigned char a[2];
36 a[0] = 8;
37 a[1] = 9;
38 ASSERT(f (a) == 2);
39 return;