More semantic analysis of initializers.
Added 2 errors and one warning, updated test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41672 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index 2a26103..3ab2f4e 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -1,5 +1,12 @@
// RUN: clang -parse-ast-check -pedantic %s
+static int x, y, z;
+
+static int ary[] = { x, y, z }; // expected-error{{initializer element is not constant}}
+int ary2[] = { x, y, z }; // expected-error{{initializer element is not constant}}
+
+extern int fileScopeExtern[3] = { 1, 3, 5 }; // expected-warning{{'extern' variable has an initializer}}
+
void func() {
int x = 1;
@@ -24,4 +31,6 @@
} z = { 1 };
struct threeElements *p = 7; // expected-warning{{incompatible types assigning 'int' to 'struct threeElements *'}}
+
+ extern int blockScopeExtern[3] = { 1, 3, 5 }; // expected-error{{'extern' variable cannot have an initializer}}
}