1 // RUN: clang-cc -verify -fsyntax-only %s
3 static int g0
; // expected-note{{previous definition}}
4 int g0
; // expected-error{{non-static declaration of 'g0' follows static declaration}}
10 __private_extern__
int g2
;
12 int g3
; // expected-note{{previous definition}}
13 static int g3
; // expected-error{{static declaration of 'g3' follows non-static declaration}}
15 extern int g4
; // expected-note{{previous definition}}
16 static int g4
; // expected-error{{static declaration of 'g4' follows non-static declaration}}
18 __private_extern__
int g5
; // expected-note{{previous definition}}
19 static int g5
; // expected-error{{static declaration of 'g5' follows non-static declaration}}
22 // FIXME: Diagnose this?
28 // FIXME: Diagnose this?
30 __private_extern__
int g7
;
34 extern int g8
; // expected-note{{previous definition}}
35 // FIXME: Improve this diagnostic.
36 int g8
; // expected-error{{redefinition of 'g8'}}
40 __private_extern__
int g9
; // expected-note{{previous definition}}
41 // FIXME: Improve this diagnostic.
42 int g9
; // expected-error{{redefinition of 'g9'}}
51 __private_extern__
int g11
;
52 __private_extern__
int g11
;
58 __private_extern__
int g12
;
63 __private_extern__
int g13
;
70 __private_extern__
struct s0 g14
;
75 extern int g15
= 0; // expected-error{{'extern' variable cannot have an initializer}}
76 // FIXME: linkage specifier in warning.
77 __private_extern__
int g16
= 0; // expected-error{{'extern' variable cannot have an initializer}}
83 extern int g18
= 0; // expected-warning{{'extern' variable has an initializer}}
85 __private_extern__
int g19
;
88 __private_extern__
int g20
= 0;