Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/20000801-4.c

raw
1 /* Origin: PR c/128 from Martin Sebor <[email protected]>, adapted
2 as a testcase by Joseph Myers <[email protected]>.
3 */
4 /* Character arrays initialized by a string literal must have
5 uninitialized elements zeroed. This isn't clear in the 1990
6 standard, but was fixed in TC2 and C99; see DRs #060, #092.
7 */
8 extern void abort (void);
9 extern void exit (int);
10
11 int
12 foo (void)
13 {
14 char s[2] = "";
15 return 0 == s[1];
16 }
17
18 char *t;
19
20 int
21 main (void)
22 {
23 {
24 char s[] = "x";
25 t = s;
26 }
27 if (foo ())
28 exit (0);
29 else
30 abort ();
31 }