]> granicus.if.org Git - clang/commitdiff
Bring over a test from llvm/test/FrontendC that is for Sema and not CodeGen.
authorEric Christopher <echristo@apple.com>
Fri, 22 Jul 2011 07:26:22 +0000 (07:26 +0000)
committerEric Christopher <echristo@apple.com>
Fri, 22 Jul 2011 07:26:22 +0000 (07:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135753 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/crash-invalid-array.c [new file with mode: 0644]

diff --git a/test/Sema/crash-invalid-array.c b/test/Sema/crash-invalid-array.c
new file mode 100644 (file)
index 0000000..a3bc03b
--- /dev/null
@@ -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;
+   }
+}