forked from OSchip/llvm-project
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. llvm-svn: 283870
This commit is contained in:
parent
7a325537fb
commit
628c5377b0
|
@ -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, TestSimpleDarwinFunction) {
|
|||
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, TestMediumDarwinFunction) {
|
|||
|
||||
EXPECT_TRUE(row_sp->GetRegisterInfo(arm64_dwarf::x22, regloc));
|
||||
EXPECT_TRUE(regloc.IsSame());
|
||||
|
||||
terminate();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue