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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wunreachable-code-1.C] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* PR17544 Incorrect -Wunreachable-code warning
2
   Origin: sebor@roguewave.com
3
 
4
   G++ appends a "return 0;" when finishing a function, but it was not
5
   given a source location.  The gimplifier thinks a return statement
6
   needs a locus so it would add one, making the compiler generated code
7
   visible to the unreachable code warning.  */
8
 
9
/* { dg-do compile } */
10
/* { dg-options "-O -Wunreachable-code" } */
11
 
12
int
13
main (int argc, char *argv[])
14
{
15
  const char* const s = argc < 2 ? "" : argv [1];
16
  int i = 0;
17
  do {
18
    ++i;
19
  } while (i < s [0]);
20
  return i;
21
}
22
 

powered by: WebSVN 2.1.0

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