struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20120207-1.c
blobd7d1bc198dac90007b4354ef435074ee8c852e52
1 /*
2 20120207-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 /* PR middle-end/51994 */
12 /* Testcase by Uros Bizjak <ubizjak@gmail.com> */
14 extern char *strcpy (char *, const char *);
16 char
17 test (int a)
19 char buf[16];
20 char *output = buf;
22 strcpy (&buf[0], "0123456789");
24 output += a;
25 output -= 1;
27 return output[0];
30 void
31 testTortureExecute (void)
33 if (test (2) != '1')
34 ASSERT (0);