aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-07-22 07:26:22 +0000
committerEric Christopher <echristo@apple.com>2011-07-22 07:26:22 +0000
commit7c634a04a23171cc2356e3129fb16b8e9da3bf00 (patch)
tree06bf8222e4b0b7b3c24f265902f061faffb138e5
parent01c5d1ddc8bd589b629b8c0185c279d090bba115 (diff)
Bring over a test from llvm/test/FrontendC that is for Sema and not CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135753 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Sema/crash-invalid-array.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Sema/crash-invalid-array.c b/test/Sema/crash-invalid-array.c
new file mode 100644
index 0000000000..a3bc03b70b
--- /dev/null
+++ b/test/Sema/crash-invalid-array.c
@@ -0,0 +1,17 @@
+// RUN: not %clang_cc1 -O1 %s -emit-llvm
+// PR6913
+
+#include <stdio.h>
+
+int main()
+{
+ int x[10][10];
+ int (*p)[] = x; // expected-error {{invalid use of array with unspecified bounds}
+
+ int i;
+
+ for(i = 0; i < 10; ++i)
+ {
+ p[i][i] = i;
+ }
+}