Fix memory leak in tests.
authorEaswaran Raman <eraman@google.com>
Thu, 3 Mar 2016 23:55:41 +0000 (23:55 +0000)
committerEaswaran Raman <eraman@google.com>
Thu, 3 Mar 2016 23:55:41 +0000 (23:55 +0000)
llvm-svn: 262674

llvm/unittests/ProfileData/InstrProfTest.cpp
llvm/unittests/ProfileData/SampleProfTest.cpp

index 447f7a2..46e493e 100644 (file)
@@ -187,6 +187,7 @@ TEST_F(InstrProfTest, get_profile_summary) {
   ASSERT_TRUE(isa<InstrProfSummary>(PSFromMD));
   InstrProfSummary *IPS = cast<InstrProfSummary>(PSFromMD);
   VerifySummary(*IPS, false);
+  delete IPS;
 }
 
 TEST_P(MaybeSparseInstrProfTest, get_icall_data_read_write) {
index 5ab4f56..9738e97 100644 (file)
@@ -133,6 +133,7 @@ struct SampleProfTest : ::testing::Test {
     ASSERT_TRUE(isa<SampleProfileSummary>(PS));
     SampleProfileSummary *SPS = cast<SampleProfileSummary>(PS);
     VerifySummary(*SPS);
+    delete SPS;
   }
 };