Index: llvm/trunk/lib/CodeGen/MachineDominators.cpp =================================================================== --- llvm/trunk/lib/CodeGen/MachineDominators.cpp +++ llvm/trunk/lib/CodeGen/MachineDominators.cpp @@ -143,6 +143,10 @@ } void MachineDominatorTree::verifyDomTree() const { + if (getRoots().empty()) + // If dominator tree is unavailable, skip verification. + return; + MachineFunction &F = *getRoot()->getParent(); MachineDominatorTree OtherDT; Index: llvm/trunk/lib/IR/Dominators.cpp =================================================================== --- llvm/trunk/lib/IR/Dominators.cpp +++ llvm/trunk/lib/IR/Dominators.cpp @@ -291,6 +291,10 @@ } void DominatorTree::verifyDomTree() const { + if (getRoots().empty()) + // If dominator tree is unavailable, skip verification. + return; + Function &F = *getRoot()->getParent(); DominatorTree OtherDT; Index: llvm/trunk/test/CodeGen/Generic/externally_available.ll =================================================================== --- llvm/trunk/test/CodeGen/Generic/externally_available.ll +++ llvm/trunk/test/CodeGen/Generic/externally_available.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s | not grep test_ +; RUN: llc -verify-machine-dom-info < %s | not grep test_ ; test_function should not be emitted to the .s file. define available_externally i32 @test_function() {