if (isa<FileScopeAsmDecl>(D))
return true;
if (VarDecl *Var = dyn_cast<VarDecl>(D))
- return Var->isFileVarDecl() && Var->getInit();
+ return Var->isFileVarDecl() &&
+ Var->isThisDeclarationADefinition() == VarDecl::Definition;
if (FunctionDecl *Func = dyn_cast<FunctionDecl>(D))
return Func->isThisDeclarationADefinition();
return isa<ObjCProtocolDecl>(D);
// CHECK: @_ZL5globS = internal global %struct.S zeroinitializer
// CHECK: @_ZL3bar = internal global i32 0, align 4
+// CHECK: @glob_var = global i32 0
extern int ext_foo;
static int bar = ++ext_foo;
+
+int glob_var;