8sa1-gcc/gcc/testsuite/gcc.c-torture/execute/20000801-4.c
Joseph Myers bcde31938d 20000801-3.c, [...]: New tests.
* gcc.c-torture/execute/20000801-3.c, gcc.c-torture/20000801-4.c:
	New tests.
	* gcc.c-torture/execute/20000801-3.x, gcc/c-torture/20000801-4.x:
	Xfail.

From-SVN: r35445
2000-08-03 01:36:13 -06:00

28 lines
498 B
C

/* Origin: PR c/128 from Martin Sebor <sebor@roguewave.com>, adapted
as a testcase by Joseph Myers <jsm28@cam.ac.uk>.
*/
/* Character arrays initialised by a string literal must have
uninitialised elements zeroed. This isn't clear in the 1990
standard, but was fixed in TC2 and C99; see DRs #060, #092.
*/
extern void abort (void);
int
foo (void)
{
char s[2] = "";
return 0 == s[1];
}
int
main (void)
{
{
char s[] = "x";
}
if (foo ())
exit (0);
else
abort ();
}