From 8d486731559ba0c5e12c27b4a507181333702b7e Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 16 Jul 2014 16:23:40 +0100 Subject: Use the thumb2 assembler for the optimizing compiler. Change-Id: I2b058f4433504dc3299c06f5cb0b5ab12f34aa82 --- compiler/optimizing/codegen_test.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/codegen_test.cc') diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc index 7ec0c84167..bfdc30f26b 100644 --- a/compiler/optimizing/codegen_test.cc +++ b/compiler/optimizing/codegen_test.cc @@ -48,10 +48,17 @@ class InternalCodeAllocator : public CodeAllocator { }; #if defined(__i386__) || defined(__arm__) || defined(__x86_64__) -static void Run(const InternalCodeAllocator& allocator, bool has_result, int32_t expected) { +static void Run(const InternalCodeAllocator& allocator, + const CodeGenerator& codegen, + bool has_result, + int32_t expected) { typedef int32_t (*fptr)(); CommonCompilerTest::MakeExecutable(allocator.GetMemory(), allocator.GetSize()); fptr f = reinterpret_cast(allocator.GetMemory()); + if (codegen.GetInstructionSet() == kThumb2) { + // For thumb we need the bottom bit set. + f = reinterpret_cast(reinterpret_cast(f) + 1); + } int32_t result = f(); if (has_result) { CHECK_EQ(result, expected); @@ -71,19 +78,19 @@ static void TestCode(const uint16_t* data, bool has_result = false, int32_t expe CodeGenerator* codegen = CodeGenerator::Create(&arena, graph, kX86); codegen->CompileBaseline(&allocator); #if defined(__i386__) - Run(allocator, has_result, expected); + Run(allocator, *codegen, has_result, expected); #endif codegen = CodeGenerator::Create(&arena, graph, kArm); codegen->CompileBaseline(&allocator); #if defined(__arm__) - Run(allocator, has_result, expected); + Run(allocator, *codegen, has_result, expected); #endif codegen = CodeGenerator::Create(&arena, graph, kX86_64); codegen->CompileBaseline(&allocator); #if defined(__x86_64__) - Run(allocator, has_result, expected); + Run(allocator, *codegen, has_result, expected); #endif } -- cgit v1.2.3-59-g8ed1b