summaryrefslogtreecommitdiffstats
path: root/test/Sema/var-redecl.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/var-redecl.c')
-rw-r--r--test/Sema/var-redecl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/Sema/var-redecl.c b/test/Sema/var-redecl.c
index 0e30aa2..811e9f1 100644
--- a/test/Sema/var-redecl.c
+++ b/test/Sema/var-redecl.c
@@ -4,7 +4,7 @@ int outer1; // expected-note{{previous definition is here}}
extern int outer2; // expected-note{{previous definition is here}}
int outer4;
int outer4; // expected-note{{previous definition is here}}
-int outer5; // expected-note{{previous definition is here}}
+int outer5;
int outer6(float); // expected-note{{previous definition is here}}
int outer7(float);
@@ -13,7 +13,7 @@ void outer_test() {
extern float outer2; // expected-error{{redefinition of 'outer2' with a different type}}
extern float outer3; // expected-note{{previous definition is here}}
double outer4;
- extern int outer5;
+ extern int outer5; // expected-note{{previous definition is here}}
extern int outer6; // expected-error{{redefinition of 'outer6' as different kind of symbol}}
int outer7;
extern int outer8; // expected-note{{previous definition is here}}
@@ -60,3 +60,11 @@ int *p=&g19; // expected-error{{use of undeclared identifier 'g19'}} \
static int a;
extern int a; // expected-note {{previous declaration is here}}
int a; // expected-error {{non-static declaration of 'a' follows static declaration}}
+
+void f(int x) { // expected-note {{previous definition is here}}
+ extern int x; // expected-error {{extern declaration of 'x' follows non-extern declaration}}
+}
+
+extern int b[];
+void g20() { extern int b[3]; } // expected-note{{previous definition is here}}
+void g21() { extern int b[4]; } // expected-error{{redefinition of 'b' with a different type: 'int [4]' vs 'int [3]'}}
OpenPOWER on IntegriCloud