2008-01-30 00:44:01 +00:00
|
|
|
// RUN: clang %s -verify -fsyntax-only
|
|
|
|
|
|
|
|
const int a [1] = {1};
|
|
|
|
extern const int a[];
|
|
|
|
|
|
|
|
extern const int b[];
|
|
|
|
const int b [1] = {1};
|
|
|
|
|
|
|
|
extern const int c[] = {1}; // expected-warning{{'extern' variable has an initializer}}
|
|
|
|
const int c[];
|
|
|
|
|
|
|
|
int i1 = 1; // expected-error{{previous definition is here}}
|
|
|
|
int i1 = 2; // expected-error{{redefinition of 'i1'}} // expected-error{{previous definition is here}}
|
2008-08-08 17:50:35 +00:00
|
|
|
int i1;
|
2008-01-30 00:44:01 +00:00
|
|
|
int i1;
|
|
|
|
extern int i1; // expected-error{{previous definition is here}}
|
|
|
|
static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}} expected-error{{previous definition is here}}
|
2008-08-08 17:50:35 +00:00
|
|
|
int i1 = 3; // expected-error{{redefinition of 'i1'}} expected-error{{non-static declaration of 'i1' follows static declaration}}
|
2008-01-30 00:44:01 +00:00
|
|
|
|
2008-05-12 22:36:43 +00:00
|
|
|
__private_extern__ int pExtern;
|
|
|
|
int pExtern = 0;
|
|
|
|
|
2008-08-08 17:50:35 +00:00
|
|
|
int i4;
|
|
|
|
int i4;
|
|
|
|
extern int i4;
|
|
|
|
|
2008-01-30 00:44:01 +00:00
|
|
|
void func() {
|
|
|
|
extern int i1; // expected-error{{previous definition is here}}
|
|
|
|
static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}}
|
|
|
|
}
|