[Lldb-commits] [lldb] r283870 - Fix Arm64InstEmulation tests for windows
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 11 04:05:35 PDT 2016
Author: labath
Date: Tue Oct 11 06:05:34 2016
New Revision: 283870
URL: http://llvm.org/viewvc/llvm-project?rev=283870&view=rev
Log:
Fix Arm64InstEmulation tests for windows
MSVC does not like the declaration of a terminate() function (I guess it looks
too much like std::terminate()). While I'm there, move the setup/teardown code
into the functions gtest provides for that purpose.
Modified:
lldb/trunk/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
Modified: lldb/trunk/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp?rev=283870&r1=283869&r2=283870&view=diff
==============================================================================
--- lldb/trunk/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp (original)
+++ lldb/trunk/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp Tue Oct 11 06:05:34 2016
@@ -31,18 +31,16 @@ using namespace lldb_private;
class TestArm64InstEmulation : public testing::Test {
public:
- // static void SetUpTestCase() { }
-
- // static void TearDownTestCase() { }
+ static void SetUpTestCase();
+ static void TearDownTestCase();
// virtual void SetUp() override { }
-
// virtual void TearDown() override { }
protected:
};
-static void init() {
+void TestArm64InstEmulation::SetUpTestCase() {
llvm::InitializeAllTargets();
llvm::InitializeAllAsmPrinters();
llvm::InitializeAllTargetMCs();
@@ -51,15 +49,12 @@ static void init() {
EmulateInstructionARM64::Initialize();
}
-static void terminate() {
+void TestArm64InstEmulation::TearDownTestCase() {
DisassemblerLLVMC::Terminate();
EmulateInstructionARM64::Terminate();
}
TEST_F(TestArm64InstEmulation, TestSimpleDarwinFunction) {
-
- init();
-
ArchSpec arch("arm64-apple-ios10", nullptr);
UnwindAssemblyInstEmulation *engine =
static_cast<UnwindAssemblyInstEmulation *>(
@@ -153,13 +148,9 @@ TEST_F(TestArm64InstEmulation, TestSimpl
EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == arm64_dwarf::sp);
EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
-
- terminate();
}
TEST_F(TestArm64InstEmulation, TestMediumDarwinFunction) {
- init();
-
ArchSpec arch("arm64-apple-ios10", nullptr);
UnwindAssemblyInstEmulation *engine =
static_cast<UnwindAssemblyInstEmulation *>(
@@ -319,6 +310,4 @@ TEST_F(TestArm64InstEmulation, TestMediu
EXPECT_TRUE(row_sp->GetRegisterInfo(arm64_dwarf::x22, regloc));
EXPECT_TRUE(regloc.IsSame());
-
- terminate();
}
More information about the lldb-commits
mailing list