summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wunused-var-1.c
blob: d60dd70e57345a78167703a9720fcf052466dc61 (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
/* { dg-do compile } */
/* { dg-options "-Wunused" } */

int
f1 (void)
{
  int a;
  int foo (void)
  {
    return a;
  }
  a = 1;
  return foo ();
}

void
f2 (void)
{
  int a;	/* { dg-warning "set but not used" } */
  void foo (void)
  {
    a = 2;
  }
  a = 1;
  foo ();
}