summaryrefslogtreecommitdiff
path: root/compiler/optimizing/codegen_test_utils.h
diff options
context:
space:
mode:
authorAndroid Build Role Account android-build-prod <android-build-team-robot@google.com>2021-02-19 11:01:20 +0000
committerAndroid Build Role Account android-build-prod <android-build-team-robot@google.com>2021-02-19 11:01:20 +0000
commit8ee42794a152f6377b12eb1c03bc45b17dc18e76 (patch)
tree89d150872016056354366b0115dfdac8082b7248 /compiler/optimizing/codegen_test_utils.h
parentb944d4abd5852df000a22a8a57aa5637eb4441c2 (diff)
parent9ce7222bf723e2ec87d74e1b0fd3e265eca2e6fe (diff)
Snap for 7156330 from 9ce7222bf723e2ec87d74e1b0fd3e265eca2e6fe to s-keystone-qcom-release
Change-Id: Ifab76b74366daf232cd65500485b9cf48ea96521
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
-rw-r--r--compiler/optimizing/codegen_test_utils.h12
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);