summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/uninit-pr20644.c
blob: e13910becd12cb45808fdb9610b9de95761a9dd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* PR 20644 */
/* { dg-do compile } */
/* { dg-options "-O -Wuninitialized" } */
int foo ()
{
  int i = 0;
  int j;

  if (1 == i)
    return j;

  return 0;
}

int bar ()
{
  int i = 1;
  int j;

  if (1 == i)
    return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } 18 } */

  return 0;
}