2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-5.c
blobac760d69e034523339c5235bdcfec408b19e4c9e
1 /* Spurious uninitialized-variable warnings.
2 These cases are documented as not working in the gcc manual. */
4 /* { dg-do compile } */
5 /* { dg-options "-O -Wuninitialized" } */
7 extern void use(int);
8 extern void foo(void);
10 void
11 func1(int cond)
13 int x; /* { dg-bogus "x" "uninitialized variable warning" { xfail *-*-* } } */
15 if(cond)
16 x = 1;
18 foo();
20 if(cond)
21 use(x);
24 void
25 func2 (int cond)
27 int x; /* { dg-bogus "x" "uninitialized variable warning" { xfail *-*-* } } */
28 int flag = 0;
30 if(cond)
32 x = 1;
33 flag = 1;
36 foo();
38 if(flag)
39 use(x);