gcc/testsuite/gcc.c-torture/execute/930518-1.c
raw| 1 | /* { dg-additional-options "-std=gnu89" } */ |
| 2 | |
| 3 | int bar = 0; |
| 4 | |
| 5 | f (p) |
| 6 | int *p; |
| 7 | { |
| 8 | int foo = 2; |
| 9 | |
| 10 | while (foo > bar) |
| 11 | { |
| 12 | foo -= bar; |
| 13 | *p++ = foo; |
| 14 | bar = 1; |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | main () |
| 19 | { |
| 20 | int tab[2]; |
| 21 | tab[0] = tab[1] = 0; |
| 22 | f (tab); |
| 23 | if (tab[0] != 2 || tab[1] != 1) |
| 24 | abort (); |
| 25 | exit (0); |
| 26 | } |