Index: llvm/trunk/lib/IR/Verifier.cpp =================================================================== --- llvm/trunk/lib/IR/Verifier.cpp +++ llvm/trunk/lib/IR/Verifier.cpp @@ -1173,8 +1173,6 @@ void Verifier::visitDIGlobalVariableExpression( const DIGlobalVariableExpression &GVE) { AssertDI(GVE.getVariable(), "missing variable"); - if (auto *Var = GVE.getVariable()) - visitDIGlobalVariable(*Var); if (auto *Expr = GVE.getExpression()) visitDIExpression(*Expr); } Index: llvm/trunk/test/DebugInfo/pr34186.ll =================================================================== --- llvm/trunk/test/DebugInfo/pr34186.ll +++ llvm/trunk/test/DebugInfo/pr34186.ll @@ -1,5 +1,7 @@ +; Make sure we reject GVs without a type and we verify each exactly once. ; RUN: not llc %s 2>&1 | FileCheck %s ; CHECK: missing global variable type +; CHECK-NOT: missing global variable type !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!63, !64}