Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / warn / Wunreachable-code-1.C
blob23fc86dfbb28617d7ae93c4d9b26cd658a6a92a3
1 /* PR17544 Incorrect -Wunreachable-code warning
2    Origin: sebor@roguewave.com
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.  */
9 /* { dg-do compile } */
10 /* { dg-options "-O -Wunreachable-code" } */
12 int
13 main (int argc, char *argv[])
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;