OSDN Git Service

patch for PR rtl-optimization/25130
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / Wunreachable-2.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wunreachable-code" } */
3
4 extern int foo (const char *);
5 extern void baz (void);
6 const char *a[] = { "one", "two" };
7
8 void bar (void)
9 {
10   int i;
11
12   for (i = 0; i < 2; i++)
13     if (! foo (a[i]))
14       return;
15
16   baz ();       /* { dg-bogus "will never be executed" } */
17   baz ();
18   baz ();
19 }