IRTests/IRBuilderTest.cpp: Let GV added to the module.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 23 Jan 2013 08:30:39 +0000 (08:30 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 23 Jan 2013 08:30:39 +0000 (08:30 +0000)
It fixes --vg-leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173237 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/IR/IRBuilderTest.cpp

index c56721f51b6823c730fd353421555849dd9444d9..8c3471c3de4f347873d4a13b4e66deb61e2ea45b 100644 (file)
@@ -30,8 +30,8 @@ protected:
                                           /*isVarArg=*/false);
     F = Function::Create(FTy, Function::ExternalLinkage, "", M.get());
     BB = BasicBlock::Create(getGlobalContext(), "", F);
-    GV = new GlobalVariable(Type::getFloatTy(getGlobalContext()), true,
-                            GlobalValue::ExternalLinkage);
+    GV = new GlobalVariable(*M, Type::getFloatTy(getGlobalContext()), true,
+                            GlobalValue::ExternalLinkage, 0);
   }
 
   virtual void TearDown() {