aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/Winit-self2.c
blob: 13aa9efdf26153f20bc5b609c3ab93768793843a (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
25
26
27
28
29
30
31
/* PR middle-end/102633 */
/* { dg-do compile } */
/* { dg-options "-Wuninitialized -Winit-self" } */

int
fn1 (void)
{
  int i = i; /* { dg-warning "used uninitialized" } */
  return i;
}

int
fn2 ()
{
  const int j = j; /* { dg-warning "used uninitialized" } */
  return j;
}

int
fn3 ()
{
  volatile int k = k; /* { dg-warning "used uninitialized" } */
  return k;
}

int
fn4 ()
{
  const volatile int l = l; /* { dg-warning "used uninitialized" } */
  return l;
}