OSDN Git Service

* gcc.dg/pr31344.c: Move to ...
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / pr17506.c
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" } */
7
8 inline int
9 foo (int i)
10 {
11   if (i) /* { dg-warning "used uninitialized in this function" } */
12     return 1;
13   return 0;
14 }
15
16 void baz (void);
17
18 void
19 bar (void)
20 {
21   int j; /* { dg-message "note: 'j' was declared here" } */
22   for (; foo (j); ++j)
23     baz ();
24 }