re PR tree-optimization/34172 (Missed store ccp optimization)
[official-gcc.git] / gcc / testsuite / gcc.dg / pr17506.c
blob7cca74613e7bf98638967f797a1b175b39ded101
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
4 make it less confusing. */
5 /* { dg-do compile } */
6 /* { dg-options "-O1 -Wuninitialized" } */
8 inline int
9 foo (int i)
11 if (i) /* { dg-warning "used uninitialized in this function" } */
12 return 1;
13 return 0;
16 void baz (void);
18 void
19 bar (void)
21 int j; /* { dg-message "note: 'j' was declared here" } */
22 for (; foo (j); ++j)
23 baz ();