summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2010-03-13 02:15:08 +0000
committerJeffrey Yasskin <jyasskin@google.com>2010-03-13 02:15:08 +0000
commit241611570aa6783ee457af812a712030fa45ffe2 (patch)
tree1a104ab35355c74d8653928bafc78f9883ed3ea9 /unittests
parent1bd1e6db1d5ae9ae0f07bef5db355e8a1cf5d5b4 (diff)
downloadllvm-241611570aa6783ee457af812a712030fa45ffe2.tar.gz
llvm-241611570aa6783ee457af812a712030fa45ffe2.tar.bz2
llvm-241611570aa6783ee457af812a712030fa45ffe2.tar.xz
Remove the last memory leak from the VMCore unit tests.
Tested: valgrind --leak-check=full unittests/VMCore/Debug/VMCoreTests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/VMCore/PassManagerTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/unittests/VMCore/PassManagerTest.cpp b/unittests/VMCore/PassManagerTest.cpp
index cb8f9ebb93..bc21298ef2 100644
--- a/unittests/VMCore/PassManagerTest.cpp
+++ b/unittests/VMCore/PassManagerTest.cpp
@@ -324,10 +324,10 @@ namespace llvm {
template<typename T>
void MemoryTestHelper(int run) {
- Module *M = makeLLVMModule();
+ OwningPtr<Module> M(makeLLVMModule());
T *P = new T();
PassManager Passes;
- Passes.add(new TargetData(M));
+ Passes.add(new TargetData(M.get()));
Passes.add(P);
Passes.run(*M);
T::finishedOK(run);