OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wunreachable-code-1.C] - Rev 774

Go to most recent revision | Compare with Previous | Blame | View Log

/* PR17544 Incorrect -Wunreachable-code warning
   Origin: sebor@roguewave.com

   G++ appends a "return 0;" when finishing a function, but it was not
   given a source location.  The gimplifier thinks a return statement
   needs a locus so it would add one, making the compiler generated code
   visible to the unreachable code warning.  */

/* { dg-do compile } */
/* { dg-options "-O -Wunreachable-code" } */

int
main (int argc, char *argv[])
{
  const char* const s = argc < 2 ? "" : argv [1];
  int i = 0;
  do {
    ++i;
  } while (i < s [0]);
  return i;
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.