blob: 0c390fe4144bc62d43e7b752177308ae5c72a7ee [file] [log] [blame]
Steve Naroffb7b032e2008-01-30 00:44:01 +00001// RUN: clang %s -verify -fsyntax-only
2
3const int a [1] = {1};
4extern const int a[];
5
6extern const int b[];
7const int b [1] = {1};
8
9extern const int c[] = {1}; // expected-warning{{'extern' variable has an initializer}}
10const int c[];
11
12int i1 = 1; // expected-error{{previous definition is here}}
13int i1 = 2; // expected-error{{redefinition of 'i1'}} // expected-error{{previous definition is here}}
14// FIXME: the following should not be an error (see related FIXME in Sema::MergeVarDecl).
15int i1; // expected-error{{redefinition of 'i1'}}
16int i1;
17extern int i1; // expected-error{{previous definition is here}}
18static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}} expected-error{{previous definition is here}}
19int i1 = 3; // expected-error{{non-static declaration of 'i1' follows static declaration}}
20
21void func() {
22 extern int i1; // expected-error{{previous definition is here}}
23 static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}}
24}