aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/array-init.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/array-init.c')
-rw-r--r--test/Sema/array-init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index 98387bedd0..5eed259dff 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -1,5 +1,7 @@
// RUN: clang -parse-ast-check -pedantic %s
+extern int foof() = 1; // expected-error{{illegal initializer (only variables can be initialized)}}
+
static int x, y, z;
static int ary[] = { x, y, z }; // expected-error{{initializer element is not constant}}
@@ -12,6 +14,8 @@ static int ary3[] = { 1, "abc", 3, 4 }; // expected-warning{{incompatible types
void func() {
int x = 1;
+ typedef int TInt = 1; // expected-error{{illegal initializer (only variables can be initialized)}}
+
int xComputeSize[] = { 1, 3, 5 };
int x3[x] = { 1, 2 }; // expected-error{{variable-sized object may not be initialized}}