aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/crash-invalid-array.c
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-04-29 22:01:25 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-04-29 22:01:25 +0000
commitd237d2e6b85a74f31c986dc585fa6c39733b74a2 (patch)
tree3fea7e7e53d2cc9d3d0e348ad40060508883198b /test/Sema/crash-invalid-array.c
parent548107ee5241037b4533d86afbe0cf38ddf6b5d9 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/crash-invalid-array.c')
-rw-r--r--test/Sema/crash-invalid-array.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Sema/crash-invalid-array.c b/test/Sema/crash-invalid-array.c
index a3bc03b70b..eeac39148c 100644
--- a/test/Sema/crash-invalid-array.c
+++ b/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}}