Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-5.c
blob21ac9eec6f8ba3721e3b4d61b28540bd47d83e5b
1 /* Spurious uninitialized-variable warnings. */
3 /* { dg-do compile } */
4 /* { dg-options "-O -Wuninitialized" } */
6 extern void use(int);
7 extern void foo(void);
9 void
10 func1(int cond)
12 int x; /* { dg-bogus "x" "uninitialized variable warning" { xfail *-*-* } } */
14 if(cond)
15 x = 1;
17 foo();
19 if(cond)
20 use(x);
23 void
24 func2 (int cond)
26 int x; /* { dg-bogus "x" "uninitialized variable warning" { xfail *-*-* } } */
27 int flag = 0;
29 if(cond)
31 x = 1;
32 flag = 1;
35 foo();
37 if(flag)
38 use(x);