gcc/testsuite/gcc.c-torture/execute/20090814-1.c
raw| 1 | int __attribute__((noinline)) |
| 2 | bar (int *a) |
| 3 | { |
| 4 | return *a; |
| 5 | } |
| 6 | int i; |
| 7 | int __attribute__((noinline)) |
| 8 | foo (int (*a)[2]) |
| 9 | { |
| 10 | return bar (&(*a)[i]); |
| 11 | } |
| 12 | |
| 13 | extern void abort (void); |
| 14 | int a[2]; |
| 15 | int main() |
| 16 | { |
| 17 | a[0] = -1; |
| 18 | a[1] = 42; |
| 19 | i = 1; |
| 20 | if (foo (&a) != 42) |
| 21 | abort (); |
| 22 | return 0; |
| 23 | } |