diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-04-29 22:01:25 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-04-29 22:01:25 +0000 |
commit | 4289a5a429e3901ff5391d94e894f7ce0029865f (patch) | |
tree | 30071dd09121713e3694afaacbd8ca7b0f760f05 /clang/test | |
parent | 474df6d3ede6428fbd1f04b4501f0944a358c1f5 (diff) | |
download | bcm5719-llvm-4289a5a429e3901ff5391d94e894f7ce0029865f.tar.gz bcm5719-llvm-4289a5a429e3901ff5391d94e894f7ce0029865f.zip |
c language: diagnose use of "[*]" on any array dimension
in the parameter of a function definition. Currently,
it crashes in irgen if it is on other than the 1st dimension.
// rdar://13705391
llvm-svn: 180732
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Sema/crash-invalid-array.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Sema/crash-invalid-array.c b/clang/test/Sema/crash-invalid-array.c index a3bc03b70b5..eeac39148ca 100644 --- a/clang/test/Sema/crash-invalid-array.c +++ b/clang/test/Sema/crash-invalid-array.c @@ -15,3 +15,10 @@ int main() p[i][i] = i; } } + +// rdar://13705391 +void foo(int a[*][2]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} +void foo1(int a[2][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} +void foo2(int a[*][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} +void foo3(int a[2][*][2]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}} +void foo4(int a[2][*][*]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}} |