fix pr/45972
[official-gcc.git] / gcc / testsuite / c-c++-common / Wunused-var-9.c
blobb2cdc4510e168b9cc2aa972aee091d6bfc8dcb55
1 /* { dg-options "-Wunused" } */
2 /* { dg-do compile } */
4 int f1 (int *, int);
5 int f2 (int *);
6 int f3 (int *);
8 int
9 f4 (int x)
11 int a, n = 0;
12 int b;
13 for (a = f1 (&b, x); f2 (&b); (void) (a = f3 (&b)))
14 n++;
15 return n;
18 void
19 f5 (int x)
21 int a;
22 a = x;
23 (void) (a = x);
26 void
27 f6 (int x)
29 int a; /* { dg-warning "set but not used" } */
30 a = x;
33 void
34 f7 (int x)
36 int a;
37 ({ a = x; });
40 int
41 f8 (int x)
43 int a;
44 int b = ({ a = x; });
45 return b;
48 int v;
50 void
51 f9 (int x)
53 int a;
54 ({ v++, a = x; });
57 int
58 f10 (int x)
60 int a;
61 int b = ({ v++, a = x; });
62 return b;
65 void
66 f11 (int x)
68 int a;
69 a = x;
70 ({ v++, a; });
73 int
74 f12 (int x)
76 int a;
77 a = x;
78 int b = ({ v++, a; });
79 return b;