gcc/testsuite/gcc.dg/torture/pr49217.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-fno-early-inlining" } */ |
| 3 | |
| 4 | extern void abort (void); |
| 5 | int i; |
| 6 | static void foo(void); |
| 7 | void __attribute__((noinline)) |
| 8 | bar (void) |
| 9 | { |
| 10 | if (!i) |
| 11 | foo (); |
| 12 | } |
| 13 | static void |
| 14 | foo(void) |
| 15 | { |
| 16 | i = 1; |
| 17 | bar (); |
| 18 | } |
| 19 | int main() |
| 20 | { |
| 21 | i = 0; |
| 22 | bar(); |
| 23 | if (i != 1) |
| 24 | abort (); |
| 25 | return 0; |
| 26 | } |