1 // RUN: %clang_cc1 -verify -fsyntax-only -Wno-private-extern %s
2 // RUN: %clang_cc1 -verify -fsyntax-only -Wno-private-extern -fmodules %s
4 static int g0
; // expected-note{{previous definition}}
5 int g0
; // expected-error{{non-static declaration of 'g0' follows static declaration}}
11 __private_extern__
int g2
;
13 int g3
; // expected-note{{previous definition}}
14 static int g3
; // expected-error{{static declaration of 'g3' follows non-static declaration}}
16 extern int g4
; // expected-note{{previous declaration}}
17 static int g4
; // expected-error{{static declaration of 'g4' follows non-static declaration}}
19 __private_extern__
int g5
; // expected-note{{previous declaration}}
20 static int g5
; // expected-error{{static declaration of 'g5' follows non-static declaration}}
23 int g6
; // expected-note {{previous}}
24 extern int g6
; // expected-error {{extern declaration of 'g6' follows non-extern declaration}}
28 int g7
; // expected-note {{previous}}
29 __private_extern__
int g7
; // expected-error {{extern declaration of 'g7' follows non-extern declaration}}
33 extern int g8
; // expected-note{{previous declaration}}
34 int g8
; // expected-error {{non-extern declaration of 'g8' follows extern declaration}}
38 __private_extern__
int g9
; // expected-note{{previous declaration}}
39 int g9
; // expected-error {{non-extern declaration of 'g9' follows extern declaration}}
48 __private_extern__
int g11
;
49 __private_extern__
int g11
;
55 __private_extern__
int g12
;
60 __private_extern__
int g13
;
67 __private_extern__
struct s0 g14
;
72 extern int g15
= 0; // expected-error{{declaration of block scope identifier with linkage cannot have an initializer}}
73 // FIXME: linkage specifier in warning.
74 __private_extern__
int g16
= 0; // expected-error{{declaration of block scope identifier with linkage cannot have an initializer}}
80 extern int g18
= 0; // expected-warning{{'extern' variable has an initializer}}
82 __private_extern__
int g19
;
85 __private_extern__
int g20
= 0;