1 /* { dg-options "-Wunused" } */ 2 /* { dg-do compile } */ 3 4 int f1 (int *, int); 5 int f2 (int *); 6 int f3 (int *); 7 8 int f4(int x)9f4 (int x) 10 { 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; 16 } 17 18 void f5(int x)19f5 (int x) 20 { 21 int a; 22 a = x; 23 (void) (a = x); 24 } 25 26 void f6(int x)27f6 (int x) 28 { 29 int a; /* { dg-warning "set but not used" } */ 30 a = x; 31 } 32 33 void f7(int x)34f7 (int x) 35 { 36 int a; 37 ({ a = x; }); 38 } 39 40 int f8(int x)41f8 (int x) 42 { 43 int a; 44 int b = ({ a = x; }); 45 return b; 46 } 47 48 int v; 49 50 void f9(int x)51f9 (int x) 52 { 53 int a; 54 ({ v++, a = x; }); 55 } 56 57 int f10(int x)58f10 (int x) 59 { 60 int a; 61 int b = ({ v++, a = x; }); 62 return b; 63 } 64 65 void f11(int x)66f11 (int x) 67 { 68 int a; 69 a = x; 70 ({ v++, a; }); 71 } 72 73 int f12(int x)74f12 (int x) 75 { 76 int a; 77 a = x; 78 int b = ({ v++, a; }); 79 return b; 80 } 81