diff options
author | Daniel Norman <danielnorman@google.com> | 2021-02-08 11:11:02 -0800 |
---|---|---|
committer | Daniel Norman <danielnorman@google.com> | 2021-02-08 11:11:02 -0800 |
commit | 9ce7222bf723e2ec87d74e1b0fd3e265eca2e6fe (patch) | |
tree | 89d150872016056354366b0115dfdac8082b7248 /compiler/optimizing/codegen_test_utils.h | |
parent | 2ca15e8c3e0f3e7356d7a6d9a87a61659342f867 (diff) | |
parent | 78df5db462b6df6e089322257beaf0b6fabb6faa (diff) |
Merge SP1A.210208.001
Change-Id: I7f48cd9e75e97a3a77f5ec1a1dcca9e11701c2ca
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
-rw-r--r-- | compiler/optimizing/codegen_test_utils.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h index 9d15f1f294..397e601cee 100644 --- a/compiler/optimizing/codegen_test_utils.h +++ b/compiler/optimizing/codegen_test_utils.h @@ -248,9 +248,17 @@ static void Run(const InternalCodeAllocator& allocator, Expected expected) { InstructionSet target_isa = codegen.GetInstructionSet(); + struct CodeHolder : CommonCompilerTestImpl { + protected: + ClassLinker* GetClassLinker() override { return nullptr; } + Runtime* GetRuntime() override { return nullptr; } + }; + CodeHolder code_holder; + const void* code_ptr = + code_holder.MakeExecutable(allocator.GetMemory(), ArrayRef<const uint8_t>(), target_isa); + typedef Expected (*fptr)(); - CommonCompilerTest::MakeExecutable(allocator.GetMemory().data(), allocator.GetMemory().size()); - fptr f = reinterpret_cast<fptr>(reinterpret_cast<uintptr_t>(allocator.GetMemory().data())); + fptr f = reinterpret_cast<fptr>(reinterpret_cast<uintptr_t>(code_ptr)); if (target_isa == InstructionSet::kThumb2) { // For thumb we need the bottom bit set. f = reinterpret_cast<fptr>(reinterpret_cast<uintptr_t>(f) + 1); |