From 84c6e60c02645524a1f3b4c2351d6c12c21cac51 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 25 Apr 2010 05:51:14 +0000 Subject: [PATCH] testcase for PR6913 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102303 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/FrontendC/crash-invalid-array.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/FrontendC/crash-invalid-array.c diff --git a/test/FrontendC/crash-invalid-array.c b/test/FrontendC/crash-invalid-array.c new file mode 100644 index 00000000000..d602f785458 --- /dev/null +++ b/test/FrontendC/crash-invalid-array.c @@ -0,0 +1,17 @@ +// RUN: not %llvmgcc -O1 %s -S |& grep {error: invalid use of array with unspecified bounds} +// PR6913 + +#include + +int main() +{ + int x[10][10]; + int (*p)[] = x; // <-- this line is what triggered it + + int i; + + for(i = 0; i < 10; ++i) + { + p[i][i] = i; + } +}