Treat boolean vector elements as 0/-1 [PR115406]
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-15.c
blob7352662f62769ac91bd65ce71c9c0c403a98f916
1 /* PR tree-optimization/17506
2 We used to issue an uninitialized variable warning at a wrong location at
3 line 11, which is very confusing. Make sure we print out a note to
4 make it less confusing. (xfailed alternative)
5 But it is of course ok if we warn in bar about uninitialized use
6 of j. (not xfailed alternative) */
7 /* { dg-do compile } */
8 /* { dg-options "-O1 -Wuninitialized" } */
10 inline int
11 foo (int i)
13 if (i) /* { dg-warning "used uninitialized" "" { xfail *-*-* } } */
14 return 1;
15 return 0;
18 void baz (void);
20 void
21 bar (void)
23 int j; /* { dg-message "note: 'j' was declared here" } */
24 for (; foo (j); ++j) /* { dg-warning "'j' is used uninitialized" } */
25 baz ();