brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · f9644be Raw
22 lines · c
1// RUN: %clang_cc1 -Wmissing-variable-declarations -fsyntax-only -verify %s2 3int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}}4// expected-note@-1{{declare 'static' if the variable is not intended to be used outside of this translation unit}}5 6int vbad2;7int vbad2 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad2'}}8// expected-note@-1{{declare 'static' if the variable is not intended to be used outside of this translation unit}}9 10struct { // expected-note{{declare 'static' if the variable is not intended to be used outside of this translation unit}}11  int mgood1;12} vbad3; // expected-warning{{no previous extern declaration for non-static variable 'vbad3'}}13 14int vbad4;15int vbad4 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad4'}}16// expected-note@-1{{declare 'static' if the variable is not intended to be used outside of this translation unit}}17extern int vbad4;18 19extern int vgood1;20int vgood1;21int vgood1 = 10;22