Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20000801-4.c
blob8b20806a4a0a341dd7d6b9baefec6a7fd5e51a79
1 /*
2 20000801-4.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 /* Origin: PR c/128 from Martin Sebor <sebor@roguewave.com>, adapted
12 as a testcase by Joseph Myers <jsm28@cam.ac.uk>.
14 /* Character arrays initialized by a string literal must have
15 uninitialized elements zeroed. This isn't clear in the 1990
16 standard, but was fixed in TC2 and C99; see DRs #060, #092.
19 int
20 foo (void)
22 char s[2] = "";
23 return 0 == s[1];
26 char *t;
28 void
29 testTortureExecute (void)
32 char s[] = "x";
33 t = s;
35 if (foo ())
36 return;
37 else
38 ASSERT (0);