struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20030626-2.c
blob53381b76cd3704e6c5e10a4ec2773853280dd9e6
1 /*
2 20030626-2.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 <stdio.h>
13 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
14 char buf[40];
15 #endif
17 void
18 testTortureExecute (void)
20 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
21 int i = 0;
22 int l = sprintf (buf, "%s", i++ ? "string" : "other string");
23 if (l != sizeof ("other string") - 1 || i != 1)
24 ASSERT (0);
25 return;
26 #endif