]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/auto-init-uninit-15.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / auto-init-uninit-15.c
CommitLineData
a25e0b5e 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. (not 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 } */
c32f7df9 8/* { dg-options "-O1 -Wuninitialized -ftrivial-auto-var-init=zero" } */
a25e0b5e 9
10inline int
11foo (int i)
12{
13 if (i) /* { dg-warning "used uninitialized" } */
14 return 1;
15 return 0;
16}
17
18void baz (void);
19
20void
21bar (void)
22{
23 int j; /* { dg-message "note: 'j' was declared here" "" } */
24 for (; foo (j); ++j) /* { dg-warning "'j' is used uninitialized" "" { xfail *-*-* } } */
25 baz ();
26}