aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr60195.c
blob: 0a50a30be25456ab0c72ac5220708de93d4c96ef (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* PR c/60195 */
/* { dg-do compile } */
/* { dg-options "-std=c11 -Wpedantic -Wall" } */

typedef _Atomic int atomic_int;

atomic_int
fn1 (void)
{
  atomic_int y = 0;
  return y;
}

atomic_int
fn2 (void)
{
  atomic_int y = 0;
  y;
  return y;
}

atomic_int
fn3 (void)
{
  atomic_int y = 0;
  y++;
  return y;
}

void
fn4 (void)
{
  atomic_int y;
  y = 0;
  (void) y;
}

void
fn5 (void)
{
  atomic_int y = 0; /* { dg-warning "unused variable" } */
}

void
fn6 (void)
{
  atomic_int y;  /* { dg-warning "set but not used" } */
  y = 0;
}

void
fn7 (void)
{
  atomic_int y = 0;
  y++;
}