PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / Wunused-var-7.c
blob74196436db886f03ca4b7bf3eb2e61d279d42a16
1 /* PR c++/44062 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wunused" } */
5 void
6 foo (void)
8 int a, b, c, d, e, f, g;
9 a = 1;
10 b = 2;
11 c = 3;
12 d = 4;
13 e = 5;
14 f = 6;
15 g = 7;
16 a; /* { dg-warning "no effect" } */
17 b, 1; /* { dg-warning "no effect" } */
18 (void) c;
19 (void) d, 1; /* { dg-warning "no effect" } */
20 e, f, 1; /* { dg-warning "no effect" } */
21 (void) g, f, 1; /* { dg-warning "no effect" } */
24 void
25 bar (void)
27 int a;
28 int b;
29 int c; /* { dg-warning "set but not used" } */
30 a = 1;
31 b = 2;
32 c = 3;
33 c = ({ a++, b; });
36 void
37 baz (void)
39 int a;
40 int b;
41 int c;
42 int d;
43 a = 1;
44 b = 2;
45 c = 3;
46 d = 4;
47 d, ( a++, b ), c; /* { dg-warning "no effect" } */