gcc/testsuite/gcc.c-torture/execute/loop-10.c
raw| 1 | /* Reduced from PR optimization/5076, PR optimization/2847 */ |
| 2 | |
| 3 | void abort (void); |
| 4 | |
| 5 | static int count = 0; |
| 6 | |
| 7 | static void |
| 8 | inc (void) |
| 9 | { |
| 10 | count++; |
| 11 | } |
| 12 | |
| 13 | int |
| 14 | main (void) |
| 15 | { |
| 16 | int iNbr = 1; |
| 17 | int test = 0; |
| 18 | while (test == 0) |
| 19 | { |
| 20 | inc (); |
| 21 | if (iNbr == 0) |
| 22 | break; |
| 23 | else |
| 24 | { |
| 25 | inc (); |
| 26 | iNbr--; |
| 27 | } |
| 28 | test = 1; |
| 29 | } |
| 30 | if (count != 2) |
| 31 | abort (); |
| 32 | return 0; |
| 33 | } |