struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20070201-1.c
blob39a71a5a3c17021bc91ca07bb819b6bfd666a639
1 /*
2 20070201-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 #include <stdio.h>
13 /* PR middle-end/30473 */
15 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
16 char *
17 foo (char *buf, char *p)
19 sprintf (buf, "abcde", p++);
20 return p;
22 #endif
24 void
25 testTortureExecute (void)
27 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
28 #if !(defined (__GNUC__) && (__GNUC__ < 5))
29 char buf[6];
30 if (foo (buf, &buf[2]) != &buf[3])
31 ASSERT (0);
32 return;
33 #endif
34 #endif