* gcc.dg/stack-check-5.c: Skip with -fstack-protector.
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-pr19430-O0.c
blob832aeb30becb569eb57f3a414c8726f4537eee57
1 /* { dg-do compile } */
2 /* { dg-options "-O0 -Wuninitialized" } */
3 extern int bar (int);
4 extern void baz (int *);
6 int
7 foo (int i)
9 int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } } */
11 if (bar (i)) {
12 baz (&j);
13 } else {
16 return j;
19 int foo2( void ) {
20 int rc;
21 return rc; /* { dg-warning "'rc' is used uninitialized in this function" } */
22 *&rc = 0;
25 extern int printf(const char *, ...);
26 void frob(int *pi);
28 int main(void)
30 int i;
31 printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" } */
32 frob(&i);
34 return 0;
37 void foo3(int*);
38 void bar3(void) {
39 int x;
40 if(x) /* { dg-warning "'x' is used uninitialized in this function" } */
41 foo3(&x);