gcc/testsuite/gcc.c-torture/execute/pr22061-4.c
raw| 1 | void abort (void); |
| 2 | void exit (int); |
| 3 | |
| 4 | void |
| 5 | bar (int N) |
| 6 | { |
| 7 | void foo (int a[2][N++]) {} |
| 8 | int a[2][N]; |
| 9 | foo (a); |
| 10 | int b[2][N]; |
| 11 | foo (b); |
| 12 | if (sizeof (a) != sizeof (int) * 2 * 1) |
| 13 | abort (); |
| 14 | if (sizeof (b) != sizeof (int) * 2 * 2) |
| 15 | abort (); |
| 16 | if (N != 3) |
| 17 | abort (); |
| 18 | } |
| 19 | |
| 20 | int |
| 21 | main (void) |
| 22 | { |
| 23 | bar (1); |
| 24 | exit (0); |
| 25 | } |