summaryrefslogtreecommitdiff
path: root/unittests/IR/IRBuilderTest.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-30 16:37:48 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-30 16:37:48 +0000
commitd3ec0ca17ec7891af2c238f1c19a6d1cf6b250fd (patch)
treea7746c2dc7c97132f699fb42469ef687eefcfd8d /unittests/IR/IRBuilderTest.cpp
parent0c251f74ef730bf462ad4f09aac50b2721b81a5e (diff)
Verifier: Add operand checks for MDLexicalBlock
Add operand checks for `MDLexicalBlock` and `MDLexicalBlockFile`. Like `MDLocalVariable` and `MDLocation`, these nodes always require a scope. There was no test bitrot to fix here (just updated the serialization tests in test/Assembler/mdlexicalblock.ll). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233561 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/IR/IRBuilderTest.cpp')
-rw-r--r--unittests/IR/IRBuilderTest.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/unittests/IR/IRBuilderTest.cpp b/unittests/IR/IRBuilderTest.cpp
index ca378a37cd5..3901fb85434 100644
--- a/unittests/IR/IRBuilderTest.cpp
+++ b/unittests/IR/IRBuilderTest.cpp
@@ -299,7 +299,9 @@ TEST_F(IRBuilderTest, DIBuilder) {
false, true, 1, 0, true, F);
EXPECT_TRUE(SP.Verify());
AllocaInst *I = Builder.CreateAlloca(Builder.getInt8Ty());
- auto BadScope = DIB.createLexicalBlockFile(DIDescriptor(), File, 0);
+ auto BarSP = DIB.createFunction(CU, "bar", "", File, 1, Type, false, true, 1,
+ 0, true, nullptr);
+ auto BadScope = DIB.createLexicalBlockFile(BarSP, File, 0);
I->setDebugLoc(DebugLoc::get(2, 0, BadScope));
EXPECT_FALSE(SP.Verify());
DIB.finalize();