PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / Wunused-var-4.c
blobd60c476a4c6076eb026a20baedad9a7c4163ce3d
1 /* { dg-do compile } */
2 /* { dg-options "-Wunused -W" } */
4 int
5 f1 (unsigned int x)
7 int c = ({ union { unsigned int a; int b; } u; u.a = x; u.b; });
8 return c;
11 void
12 f2 (void)
14 struct S { int i; } a;
15 int b[1];
16 a.i = 1;
17 a.i; /* { dg-warning "no effect" } */
18 b[0] = 1;
19 b[0]; /* { dg-warning "no effect" } */
22 void
23 f3 (void)
25 struct S { int i; } a; /* { dg-warning "set but not used" } */
26 int b[1]; /* { dg-warning "set but not used" } */
27 a.i = 1;
28 b[0] = 1;