OSDN Git Service

* c-decl.c (grokfield): Allow typedefs for anonymous structs and
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / uninit-pred-6_a.c
1
2 /* { dg-do compile } */
3 /* { dg-options "-Wuninitialized -O2" } */
4
5 int g;
6 void bar();
7 void blah(int);
8
9 int foo (int n, int l, int m, int r)
10 {
11   int v;
12
13   if (n && l)
14     v = r;
15
16   if (m) g++;
17   else   bar();
18
19   if ( n && l)
20       blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
21
22   return 0;
23 }
24
25 int foo_2 (int n, int l, int m, int r)
26 {
27   int v;
28
29   if (n && l)
30     v = r;
31
32   if (m) g++;
33   else   bar();
34
35   if (n)
36       blah (v); /* { dg-warning "uninitialized" "warning" } */
37
38   return 0;
39 }
40