summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/uninit-15.c
blob: dee7a3b211c9e0fb29248934db72fbe60cf9ff61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-O -Wuninitialized" } */

inline int foo (int i)
{
    if (i) return 1; /* { dg-warning "is used uninitialized" } */
    return 0;
}

void baz();

void bar()
{
    int j;           /* { dg-message "was declared here" } */
    for (; foo(j); ++j)
        baz();
}