diff options
author | Android Build Role Account android-build-prod <android-build-team-robot@google.com> | 2020-09-21 23:15:29 +0000 |
---|---|---|
committer | Android Build Role Account android-build-prod <android-build-team-robot@google.com> | 2020-09-21 23:15:29 +0000 |
commit | 116fbc6ed70876411ed8bb0e5b45d53dd1c68376 (patch) | |
tree | bdd74611d3ca6b1960ef77cf0c7397135fa8795e /compiler/optimizing/codegen_test_utils.h | |
parent | a703dd7da6d39600f6b6966be99a9e79131128ca (diff) | |
parent | 549d9908c95143829c12b7b9cfcd4917b61e96e5 (diff) |
Snap for 6852288 from 549d9908c95143829c12b7b9cfcd4917b61e96e5 to s-keystone-qcom-release
Change-Id: Ief9e71b0a6ac2a7141e921bef73d6a07020dc2ec
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
-rw-r--r-- | compiler/optimizing/codegen_test_utils.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h index 9fbd7d6fc0..f873e7514e 100644 --- a/compiler/optimizing/codegen_test_utils.h +++ b/compiler/optimizing/codegen_test_utils.h @@ -223,12 +223,15 @@ static void VerifyGeneratedCode(InstructionSet target_isa, Expected expected) { ASSERT_TRUE(CanExecute(target_isa)) << "Target isa is not executable."; - // Verify on simulator. - CodeSimulatorContainer simulator(target_isa); - if (simulator.CanSimulate()) { - Expected result = SimulatorExecute<Expected>(simulator.Get(), f); - if (has_result) { - ASSERT_EQ(expected, result); + // Simulator cannot run without runtime, because it needs quick entrypoints. + if (Runtime::Current() != nullptr) { + // Verify on simulator. + CodeSimulatorContainer simulator(target_isa); + if (simulator.CanSimulate()) { + Expected result = SimulatorExecute<Expected>(simulator.Get(), f); + if (has_result) { + ASSERT_EQ(expected, result); + } } } @@ -313,25 +316,25 @@ static void RunCode(CodegenTargetConfig target_config, } #ifdef ART_ENABLE_CODEGEN_arm -CodeGenerator* create_codegen_arm_vixl32(HGraph* graph, const CompilerOptions& compiler_options) { +inline CodeGenerator* create_codegen_arm_vixl32(HGraph* graph, const CompilerOptions& compiler_options) { return new (graph->GetAllocator()) TestCodeGeneratorARMVIXL(graph, compiler_options); } #endif #ifdef ART_ENABLE_CODEGEN_arm64 -CodeGenerator* create_codegen_arm64(HGraph* graph, const CompilerOptions& compiler_options) { +inline CodeGenerator* create_codegen_arm64(HGraph* graph, const CompilerOptions& compiler_options) { return new (graph->GetAllocator()) TestCodeGeneratorARM64(graph, compiler_options); } #endif #ifdef ART_ENABLE_CODEGEN_x86 -CodeGenerator* create_codegen_x86(HGraph* graph, const CompilerOptions& compiler_options) { +inline CodeGenerator* create_codegen_x86(HGraph* graph, const CompilerOptions& compiler_options) { return new (graph->GetAllocator()) TestCodeGeneratorX86(graph, compiler_options); } #endif #ifdef ART_ENABLE_CODEGEN_x86_64 -CodeGenerator* create_codegen_x86_64(HGraph* graph, const CompilerOptions& compiler_options) { +inline CodeGenerator* create_codegen_x86_64(HGraph* graph, const CompilerOptions& compiler_options) { return new (graph->GetAllocator()) x86_64::CodeGeneratorX86_64(graph, compiler_options); } #endif |