Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -std=c99 -verify -pedantic %s |
Eli Friedman | 13ca96a | 2009-01-24 23:49:55 +0000 | [diff] [blame] | 2 | |
| 3 | int x[10]; |
| 4 | int x[] = {1,2,3}; |
| 5 | int testx[(sizeof(x) == sizeof(int) * 10) ? 1 : -1]; |
| 6 | |
| 7 | int (*a)(int (*x)[10], int (*y)[]); |
| 8 | int (*a)(int (*x)[], int (*y)[5]); |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 9 | void b() { |
| 10 | int x[10], y[5]; |
| 11 | a(&x, &y); |
| 12 | a(&y, &y); // expected-warning {{incompatible pointer}} |
| 13 | a(&x, &x); // expected-warning {{incompatible pointer}} |
Eli Friedman | 13ca96a | 2009-01-24 23:49:55 +0000 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | |