(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
Wunused-value-1.c
       1  /* PR c/97748 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-Wunused-value" } */
       4  
       5  double _Complex f ();
       6  double _Complex *p;
       7  
       8  double _Complex
       9  foo (double _Complex x)
      10  {
      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;
      33  }