struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20170401-2.c
blob827ce41d85334c6bab333f326b7c7e5120dde1e5
1 /*
2 20170401-2.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 void adjust_xy (short *, short *);
13 struct adjust_template
15 short kx_x;
16 short kx_y;
19 static struct adjust_template adjust = {1, 1};
21 void
22 testTortureExecute (void)
24 short x = 1, y = 1;
26 adjust_xy (&x, &y);
28 if (x != 2)
29 ASSERT (0);
32 void
33 adjust_xy (short *x, short *y)
35 *x = adjust.kx_x * *x + adjust.kx_y * *y;