diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2016-06-06 23:21:27 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-06-06 23:21:27 +0000 |
| commit | bb738170a9211bd420badcb9cadb0bfa340f1d81 (patch) | |
| tree | e9616b90ae6a3b68923fda6ca0dd3468a4e8041f /llvm/unittests/IR | |
| parent | 7e4e69abe21a0eec4640f5e6c9a09e520e817937 (diff) | |
| download | bcm5719-llvm-bb738170a9211bd420badcb9cadb0bfa340f1d81.tar.gz bcm5719-llvm-bb738170a9211bd420badcb9cadb0bfa340f1d81.zip | |
Verifier: Simplify and fix issue where we were not verifying unmaterialized functions.
Arrange to call verify(Function &) on each function, followed by
verify(Module &), whether the verifier is being used from the pass or
from verifyModule(). As a side effect, this fixes an issue that caused
us not to call verify(Function &) on unmaterialized functions from
verifyModule().
Differential Revision: http://reviews.llvm.org/D21042
llvm-svn: 271956
Diffstat (limited to 'llvm/unittests/IR')
| -rw-r--r-- | llvm/unittests/IR/MetadataTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp index a36e131b4bc..d3db053c099 100644 --- a/llvm/unittests/IR/MetadataTest.cpp +++ b/llvm/unittests/IR/MetadataTest.cpp @@ -2253,7 +2253,12 @@ TEST_F(FunctionAttachmentTest, Verifier) { // be verified directly, so check that the module fails to verify). EXPECT_TRUE(verifyModule(*F->getParent())); + // Nor can materializable functions. + F->setIsMaterializable(true); + EXPECT_TRUE(verifyModule(*F->getParent())); + // Functions with a body can. + F->setIsMaterializable(false); (void)new UnreachableInst(Context, BasicBlock::Create(Context, "bb", F)); EXPECT_FALSE(verifyModule(*F->getParent())); EXPECT_FALSE(verifyFunction(*F)); |

