summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-06-06 23:21:27 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-06-06 23:21:27 +0000
commit052c9ee80b7d08d96125b4716eab58104eea0e24 (patch)
tree7753294fe38d893c278d096191e8c2d4bde9fae8 /unittests
parentd97680dbf076e9c7896402d94fd1c9e920efd240 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/IR/MetadataTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/IR/MetadataTest.cpp b/unittests/IR/MetadataTest.cpp
index a36e131b4bc..d3db053c099 100644
--- a/unittests/IR/MetadataTest.cpp
+++ b/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));