teemperor created this revision.
teemperor added a reviewer: jasonmolenda.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.

We never delete the created instances, so those test fail with the memory 
sanitizer.


https://reviews.llvm.org/D42336

Files:
  unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp


Index: unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
===================================================================
--- unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
+++ unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
@@ -56,9 +56,9 @@
 
 TEST_F(TestArm64InstEmulation, TestSimpleDarwinFunction) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -152,9 +152,9 @@
 
 TEST_F(TestArm64InstEmulation, TestMediumDarwinFunction) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -314,9 +314,9 @@
 
 TEST_F(TestArm64InstEmulation, TestFramelessThreeEpilogueFunction) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -409,9 +409,9 @@
 
 TEST_F(TestArm64InstEmulation, TestRegisterSavedTwice) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -511,9 +511,9 @@
 
 TEST_F(TestArm64InstEmulation, TestRegisterDoubleSpills) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;


Index: unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
===================================================================
--- unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
+++ unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
@@ -56,9 +56,9 @@
 
 TEST_F(TestArm64InstEmulation, TestSimpleDarwinFunction) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -152,9 +152,9 @@
 
 TEST_F(TestArm64InstEmulation, TestMediumDarwinFunction) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -314,9 +314,9 @@
 
 TEST_F(TestArm64InstEmulation, TestFramelessThreeEpilogueFunction) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -409,9 +409,9 @@
 
 TEST_F(TestArm64InstEmulation, TestRegisterSavedTwice) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
@@ -511,9 +511,9 @@
 
 TEST_F(TestArm64InstEmulation, TestRegisterDoubleSpills) {
   ArchSpec arch("arm64-apple-ios10");
-  UnwindAssemblyInstEmulation *engine =
+  std::unique_ptr<UnwindAssemblyInstEmulation> engine(
       static_cast<UnwindAssemblyInstEmulation *>(
-          UnwindAssemblyInstEmulation::CreateInstance(arch));
+          UnwindAssemblyInstEmulation::CreateInstance(arch)));
   ASSERT_NE(nullptr, engine);
 
   UnwindPlan::RowSP row_sp;
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to