summaryrefslogtreecommitdiff
path: root/compiler/optimizing/codegen_test_utils.h
diff options
context:
space:
mode:
authorXueliang Zhong <xueliang.zhong@linaro.org>2019-03-07 14:48:55 +0000
committerUlyana Trafimovich <skvadrik@google.com>2020-07-16 13:31:48 +0000
commit48ca6a681efe1fa1cf82d8af918bf9bbfd35ae96 (patch)
tree87ff5251f8f843e64e3f3632c423856ba14ceadf /compiler/optimizing/codegen_test_utils.h
parentcfea667ed9bfbdd21bf9812d1598603fc359d2e1 (diff)
VIXL simulator for ART (Stage1)
Quick User Guide: test/README.simulator.md This CL enables running ART run-tests in a simulator on host machine. Some benefits of using this simulator approach: - No need to use a target device at all. Save developers from solving the device troubles: build, flash, usb, adb, etc. - Speed up development/debug/test cycle. - Allows easy debugging/testing new instruction features without real hardware. - Allows using a smaller AOSP Android manifest master-art. The Stage1 CL provides support for running 30% of current run-tests. The rest unsupported test cases are kept in knownfailures.json. Future work will be supporting proper stack frame layout between simulator and quick entrypoints, so that stack walk, QuickArgumentVisitor, deoptimization, etc can be supported. This CL adds libart(d)-simulator-container library to the ART APEX. It has cause the following increase of the APEX size (small, about 0.13% for release APEX, measured for target aosp_arm64-userdebug): Before: 88992 com.android.art.debug.apex 51612 com.android.art.release.apex 112352 com.android.art.testing.apex After: 89124 com.android.art.debug.apex 51680 com.android.art.release.apex 112468 com.android.art.testing.apex Test: art/test.py --run-test --optimizing --simulate-arm64 Test: art/test.py --run-test --optimizing --host Test: m test-art-host-gtest Change-Id: I078812dde9aaf7128d9f262b2102251927596b7f
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
-rw-r--r--compiler/optimizing/codegen_test_utils.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h
index 9d15f1f294..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);
+ }
}
}