view gcc/testsuite/gcc.dg/pr64637.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR c/64637 */
/* { dg-do compile } */
/* { dg-options "-Wunused" } */

void g ();

void
f (int b)
{
  for (int i = 0; i < b; i + b) /* { dg-warning "28:statement with no effect" } */
    g ();
  // PARM_DECLs still don't have a location, don't expect an exact location.
  for (int i = 0; i < b; b) /* { dg-warning "statement with no effect" } */
    g ();
  for (int i = 0; i < b; !i) /* { dg-warning "26:statement with no effect" } */
    g ();
  for (!b;;) /* { dg-warning "8:statement with no effect" } */
    g ();
  for (;; b * 2) /* { dg-warning "13:statement with no effect" } */
    g ();
  ({
     b / 5; /* { dg-warning "8:statement with no effect" } */
     b ^ 5;
   });
}