summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR/IRBuilderTest.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2015-06-30 22:17:29 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2015-06-30 22:17:29 +0000
commitafadf061e7f09144c32f9e720b6e333a8dd8643d (patch)
tree6dca8a14bc843d4e7b4f074081e58862beae87d7 /llvm/unittests/IR/IRBuilderTest.cpp
parentcda8688f612c4a77a6a6840a391674602d57b729 (diff)
downloadbcm5719-llvm-afadf061e7f09144c32f9e720b6e333a8dd8643d.tar.gz
bcm5719-llvm-afadf061e7f09144c32f9e720b6e333a8dd8643d.zip
Fix memory leak in unittest added in r241101.
llvm-svn: 241123
Diffstat (limited to 'llvm/unittests/IR/IRBuilderTest.cpp')
-rw-r--r--llvm/unittests/IR/IRBuilderTest.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/unittests/IR/IRBuilderTest.cpp b/llvm/unittests/IR/IRBuilderTest.cpp
index bce7b94d709..f3db68feacc 100644
--- a/llvm/unittests/IR/IRBuilderTest.cpp
+++ b/llvm/unittests/IR/IRBuilderTest.cpp
@@ -342,9 +342,11 @@ TEST_F(IRBuilderTest, DebugLoc) {
DIBuilder DIB(*M);
auto File = DIB.createFile("tmp.cpp", "/");
+ auto CU = DIB.createCompileUnit(dwarf::DW_LANG_C_plus_plus_11, "tmp.cpp", "/",
+ "", true, "", 0);
auto SPType = DIB.createSubroutineType(File, DIB.getOrCreateTypeArray(None));
auto SP =
- DIB.createFunction(File, "foo", "foo", File, 1, SPType, false, true, 1);
+ DIB.createFunction(CU, "foo", "foo", File, 1, SPType, false, true, 1);
DebugLoc DL1 = DILocation::get(Ctx, 2, 0, SP);
DebugLoc DL2 = DILocation::get(Ctx, 3, 0, SP);
@@ -363,5 +365,7 @@ TEST_F(IRBuilderTest, DebugLoc) {
EXPECT_EQ(DL2, Builder.getCurrentDebugLocation());
auto Call2 = Builder.CreateCall(Callee, None);
EXPECT_EQ(DL2, Call2->getDebugLoc());
+
+ DIB.finalize();
}
}
OpenPOWER on IntegriCloud