gcc/testsuite/gcc.dg/pr103721.c
raw| 1 | // { dg-do run } |
| 2 | // { dg-options "-O2" } |
| 3 | |
| 4 | int ipos = 0; |
| 5 | int f (int world) |
| 6 | { |
| 7 | int searchVolume = world; |
| 8 | int currentVolume = 0; |
| 9 | while (currentVolume != searchVolume && searchVolume) { |
| 10 | currentVolume = searchVolume; |
| 11 | if (ipos != 0) |
| 12 | searchVolume = 0; |
| 13 | else |
| 14 | searchVolume = 1; |
| 15 | } |
| 16 | return (currentVolume); |
| 17 | } |
| 18 | int main() |
| 19 | { |
| 20 | const int i = f (1111); |
| 21 | __builtin_printf ("%d\n", (int)(i)); |
| 22 | if (i != 1) |
| 23 | __builtin_abort (); |
| 24 | return 0; |
| 25 | } |