]>
Commit | Line | Data |
---|---|---|
c6f1d124 | 1 | /* PR tree-optimization/17506 |
2 | We 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 | |
a18b7a33 | 4 | make it less confusing. (not xfailed alternative) |
c6f1d124 | 5 | But it is of course ok if we warn in bar about uninitialized use |
a18b7a33 | 6 | of j. (xfailed alternative) */ |
25084579 | 7 | /* { dg-do compile } */ |
c6f1d124 | 8 | /* { dg-options "-O1 -Wuninitialized" } */ |
25084579 | 9 | |
c6f1d124 | 10 | inline int |
11 | foo (int i) | |
25084579 | 12 | { |
a18b7a33 | 13 | if (i) /* { dg-warning "used uninitialized in this function" } */ |
c6f1d124 | 14 | return 1; |
15 | return 0; | |
25084579 | 16 | } |
17 | ||
c6f1d124 | 18 | void baz (void); |
25084579 | 19 | |
c6f1d124 | 20 | void |
21 | bar (void) | |
25084579 | 22 | { |
a18b7a33 | 23 | int j; /* { dg-message "note: 'j' was declared here" } */ |
24 | for (; foo (j); ++j) /* { dg-warning "'j' is used uninitialized" "" { xfail *-*-* } } */ | |
c6f1d124 | 25 | baz (); |
25084579 | 26 | } |