Index: lib/CodeGen/MachineDominators.cpp =================================================================== --- lib/CodeGen/MachineDominators.cpp +++ lib/CodeGen/MachineDominators.cpp @@ -143,6 +143,11 @@ } void MachineDominatorTree::verifyDomTree() const { + if (getRoots().empty()) + // If no roots found in the dominator tree, the pass that builds it is + // likely to be skipped. + return; + MachineFunction &F = *getRoot()->getParent(); MachineDominatorTree OtherDT; Index: test/CodeGen/Generic/externally_available.ll =================================================================== --- test/CodeGen/Generic/externally_available.ll +++ 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() {