8sa1-gcc/gcc/testsuite/gcc.dg/uninit-4.c
Zack Weinberg 7b8442983d bcp-1.c: Replace abort in arg of __builtin_constant_p with a generic external function.
gcc/testsuite:
	* c-torture/execute/bcp-1.c: Replace abort in arg of
	__builtin_constant_p with a generic external function.

	* gcc.dg/20000108-1.c, gcc.dg/980211-1.c, gcc.dg/980414-1.c,
	gcc.dg/990119-1.c, gcc.dg/990409.c, gcc.dg/990424-1.c,
	gcc.dg/991230-1.c, gcc.dg/clobbers.c, gcc.dg/lineno.c,
	gcc.dg/noreturn-1.c, gcc.dg/trigraphs.c, gcc.dg/uninit-4.c:
	Prototype abort and/or exit.

	* gcc.dg/990407-1.c, gcc.dg/strpaste.c,
	gcc.dg/special/alias-1.c, gcc.dg/special/gcsec-1.c,
	gcc.dg/special/weak-1.c, gcc.dg/special/weak-2.c,
	gcc.dg/special/wkali-1.c, gcc.dg/special/wkali-2.c: Include stdlib.h.

libio/tests:
	* tfformat.c: Include stdlib.h.

From-SVN: r34110
2000-05-23 19:30:44 +00:00

53 lines
882 B
C

/* Spurious uninit variable warnings, case 4.
Simplified version of cppexp.c (cpp_parse_expr).
This one is really fragile, it gets it right if you take out case
1, or if the structure is replaced by an int, or if the structure
has fewer members (!) */
/* { dg-do compile } */
/* { dg-options "-O -Wuninitialized" } */
extern void abort (void);
struct operation {
short op;
char rprio;
char flags;
char unsignedp;
long value;
};
extern struct operation cpp_lex (void);
void
cpp_parse_expr (void)
{
int rprio; /* { dg-bogus "rprio" "uninitialized variable warning" { xfail *-*-* } } */
struct operation op;
for (;;)
{
op = cpp_lex ();
switch (op.op)
{
case 0:
break;
case 1:
return;
case 2:
rprio = 1;
break;
default:
return;
}
if (op.op == 0)
return;
if (rprio != 1)
abort();
}
}