Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / c-c++-common / Wunused-value-1.c
blob90c9d93340f246af8e8b8d9c263ece61511945a7
1 /* PR c/97748 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wunused-value" } */
5 double _Complex f ();
6 double _Complex *p;
8 double _Complex
9 foo (double _Complex x)
11 ++x; /* { dg-bogus "value computed is not used" } */
12 --x; /* { dg-bogus "value computed is not used" } */
13 x += 1; /* { dg-bogus "value computed is not used" } */
14 x += 1.0iF; /* { dg-bogus "value computed is not used" } */
15 x++; /* { dg-bogus "value computed is not used" } */
16 x--; /* { dg-bogus "value computed is not used" } */
17 x + 1; /* { dg-warning "value computed is not used" } */
18 (void) (x + 1); /* { dg-bogus "value computed is not used" } */
19 1 + f (); /* { dg-warning "value computed is not used" } */
20 f () + f (); /* { dg-warning "value computed is not used" } */
21 f () + f (), f (); /* { dg-warning "value computed is not used" } */
22 f ();
23 (void) f ();
24 *p++; /* { dg-warning "value computed is not used" } */
25 ++*p; /* { dg-bogus "value computed is not used" } */
26 (*p ? f () : 0);
27 ({ f (); });
28 ({ f () + 1; });
29 ({ f (); 0; });
30 ({ f () + 1; 0; }); /* { dg-warning "value computed is not used" } */
31 1 + ({ f (); }); /* { dg-warning "value computed is not used" } */
32 return x;