gcc/testsuite/gcc.c-torture/execute/loop-2c.c
raw| 1 | /* { dg-options "-fgnu89-inline -Wno-pointer-to-int-cast" } */ |
| 2 | |
| 3 | extern void abort (void); |
| 4 | extern void exit (int); |
| 5 | |
| 6 | int a[2]; |
| 7 | |
| 8 | __inline__ void f (int b, int o) |
| 9 | { |
| 10 | unsigned int i; |
| 11 | int *p; |
| 12 | for (p = &a[b], i = b; --i < ~0; ) |
| 13 | *--p = i * 3 + o; |
| 14 | } |
| 15 | |
| 16 | void |
| 17 | g(int b) |
| 18 | { |
| 19 | f (b, (int)a); |
| 20 | } |
| 21 | |
| 22 | int |
| 23 | main () |
| 24 | { |
| 25 | a[0] = a[1] = 0; |
| 26 | g (2); |
| 27 | if (a[0] != (int)a || a[1] != (int)a + 3) |
| 28 | abort (); |
| 29 | exit (0); |
| 30 | } |