diff options
author | Vladimir Marko <vmarko@google.com> | 2024-02-15 12:13:59 +0000 |
---|---|---|
committer | VladimĂr Marko <vmarko@google.com> | 2024-02-20 08:53:58 +0000 |
commit | 5d581b8bd10f043e6b73fa0436d5003acaca4934 (patch) | |
tree | aaacc10f87222881491a9d004b228ecd1d6e0bc3 | |
parent | 8e18c45e19e73d6e4d28c69606a4aae95e4447f7 (diff) | |
download | art-5d581b8bd10f043e6b73fa0436d5003acaca4934.tar.gz |
riscv64: Enable some gtests.
Keep tests disabled for riscv64 if they are disabled for arm
and arm64.
Fix `GetInstructionSetFromELF()` to recognize riscv64.
This partially reverts commit
476491deb9f9abb04f25888a20280d950714048b .
Test: run-gtests.sh
Bug: 271573990
Change-Id: Iccf1e2b1e93ed09eaf27884c34696f42fd752ec4
-rw-r--r-- | compiler/compiler_reflection_test.cc | 1 | ||||
-rw-r--r-- | compiler/optimizing/linearize_test.cc | 7 | ||||
-rw-r--r-- | compiler/optimizing/live_ranges_test.cc | 6 | ||||
-rw-r--r-- | compiler/optimizing/liveness_test.cc | 12 | ||||
-rw-r--r-- | compiler/optimizing/loop_optimization_test.cc | 10 | ||||
-rw-r--r-- | compiler/optimizing/ssa_liveness_analysis_test.cc | 9 | ||||
-rw-r--r-- | dex2oat/dex2oat_image_test.cc | 1 | ||||
-rw-r--r-- | dex2oat/dex2oat_test.cc | 1 | ||||
-rw-r--r-- | dex2oat/driver/compiler_driver_test.cc | 1 | ||||
-rw-r--r-- | dex2oat/verifier_deps_test.cc | 1 | ||||
-rw-r--r-- | imgdiag/imgdiag_test.cc | 1 | ||||
-rw-r--r-- | libartbase/base/common_art_test.h | 20 | ||||
-rw-r--r-- | libartpalette/apex/palette_test.cc | 13 | ||||
-rw-r--r-- | oatdump/oatdump_app_test.cc | 15 | ||||
-rw-r--r-- | oatdump/oatdump_test.cc | 4 | ||||
-rw-r--r-- | runtime/common_runtime_test.h | 5 | ||||
-rw-r--r-- | runtime/gc/space/image_space_test.cc | 2 | ||||
-rw-r--r-- | runtime/oat/elf_file.cc | 2 |
18 files changed, 10 insertions, 101 deletions
diff --git a/compiler/compiler_reflection_test.cc b/compiler/compiler_reflection_test.cc index d8e2b9e5b9..f3c07db136 100644 --- a/compiler/compiler_reflection_test.cc +++ b/compiler/compiler_reflection_test.cc @@ -29,7 +29,6 @@ namespace art HIDDEN { class CompilerReflectionTest : public CommonCompilerTest {}; TEST_F(CompilerReflectionTest, StaticMainMethod) { - TEST_DISABLED_FOR_RISCV64(); ScopedObjectAccess soa(Thread::Current()); jobject jclass_loader = LoadDex("Main"); StackHandleScope<1> hs(soa.Self()); diff --git a/compiler/optimizing/linearize_test.cc b/compiler/optimizing/linearize_test.cc index 6f4f2b6cf6..01daa23511 100644 --- a/compiler/optimizing/linearize_test.cc +++ b/compiler/optimizing/linearize_test.cc @@ -55,7 +55,6 @@ void LinearizeTest::TestCode(const std::vector<uint16_t>& data, } TEST_F(LinearizeTest, CFG1) { - TEST_DISABLED_FOR_RISCV64(); // Structure of this graph (+ are back edges) // Block0 // | @@ -81,7 +80,6 @@ TEST_F(LinearizeTest, CFG1) { } TEST_F(LinearizeTest, CFG2) { - TEST_DISABLED_FOR_RISCV64(); // Structure of this graph (+ are back edges) // Block0 // | @@ -107,7 +105,6 @@ TEST_F(LinearizeTest, CFG2) { } TEST_F(LinearizeTest, CFG3) { - TEST_DISABLED_FOR_RISCV64(); // Structure of this graph (+ are back edges) // Block0 // | @@ -135,7 +132,6 @@ TEST_F(LinearizeTest, CFG3) { } TEST_F(LinearizeTest, CFG4) { - TEST_DISABLED_FOR_RISCV64(); /* Structure of this graph (+ are back edges) // Block0 // | @@ -166,7 +162,6 @@ TEST_F(LinearizeTest, CFG4) { } TEST_F(LinearizeTest, CFG5) { - TEST_DISABLED_FOR_RISCV64(); /* Structure of this graph (+ are back edges) // Block0 // | @@ -197,7 +192,6 @@ TEST_F(LinearizeTest, CFG5) { } TEST_F(LinearizeTest, CFG6) { - TEST_DISABLED_FOR_RISCV64(); // Block0 // | // Block1 @@ -224,7 +218,6 @@ TEST_F(LinearizeTest, CFG6) { } TEST_F(LinearizeTest, CFG7) { - TEST_DISABLED_FOR_RISCV64(); // Structure of this graph (+ are back edges) // Block0 // | diff --git a/compiler/optimizing/live_ranges_test.cc b/compiler/optimizing/live_ranges_test.cc index 7e488ba41d..fb1a23eef4 100644 --- a/compiler/optimizing/live_ranges_test.cc +++ b/compiler/optimizing/live_ranges_test.cc @@ -47,7 +47,6 @@ HGraph* LiveRangesTest::BuildGraph(const std::vector<uint16_t>& data) { } TEST_F(LiveRangesTest, CFG1) { - TEST_DISABLED_FOR_RISCV64(); /* * Test the following snippet: * return 0; @@ -82,7 +81,6 @@ TEST_F(LiveRangesTest, CFG1) { } TEST_F(LiveRangesTest, CFG2) { - TEST_DISABLED_FOR_RISCV64(); /* * Test the following snippet: * var a = 0; @@ -127,7 +125,6 @@ TEST_F(LiveRangesTest, CFG2) { } TEST_F(LiveRangesTest, CFG3) { - TEST_DISABLED_FOR_RISCV64(); /* * Test the following snippet: * var a = 0; @@ -197,7 +194,6 @@ TEST_F(LiveRangesTest, CFG3) { } TEST_F(LiveRangesTest, Loop1) { - TEST_DISABLED_FOR_RISCV64(); /* * Test the following snippet: * var a = 0; @@ -274,7 +270,6 @@ TEST_F(LiveRangesTest, Loop1) { } TEST_F(LiveRangesTest, Loop2) { - TEST_DISABLED_FOR_RISCV64(); /* * Test the following snippet: * var a = 0; @@ -346,7 +341,6 @@ TEST_F(LiveRangesTest, Loop2) { } TEST_F(LiveRangesTest, CFG4) { - TEST_DISABLED_FOR_RISCV64(); /* * Test the following snippet: * var a = 0; diff --git a/compiler/optimizing/liveness_test.cc b/compiler/optimizing/liveness_test.cc index 6af07aea4e..0b421cf9e6 100644 --- a/compiler/optimizing/liveness_test.cc +++ b/compiler/optimizing/liveness_test.cc @@ -70,7 +70,6 @@ void LivenessTest::TestCode(const std::vector<uint16_t>& data, const char* expec } TEST_F(LivenessTest, CFG1) { - TEST_DISABLED_FOR_RISCV64(); const char* expected = "Block 0\n" " live in: (0)\n" @@ -94,7 +93,6 @@ TEST_F(LivenessTest, CFG1) { } TEST_F(LivenessTest, CFG2) { - TEST_DISABLED_FOR_RISCV64(); const char* expected = "Block 0\n" " live in: (0)\n" @@ -117,7 +115,6 @@ TEST_F(LivenessTest, CFG2) { } TEST_F(LivenessTest, CFG3) { - TEST_DISABLED_FOR_RISCV64(); const char* expected = "Block 0\n" // entry block " live in: (000)\n" @@ -147,7 +144,6 @@ TEST_F(LivenessTest, CFG3) { } TEST_F(LivenessTest, CFG4) { - TEST_DISABLED_FOR_RISCV64(); // var a; // if (0 == 0) { // a = 5; @@ -196,7 +192,6 @@ TEST_F(LivenessTest, CFG4) { } TEST_F(LivenessTest, CFG5) { - TEST_DISABLED_FOR_RISCV64(); // var a = 0; // if (0 == 0) { // } else { @@ -242,7 +237,6 @@ TEST_F(LivenessTest, CFG5) { } TEST_F(LivenessTest, Loop1) { - TEST_DISABLED_FOR_RISCV64(); // Simple loop with one preheader and one back edge. // var a = 0; // while (a == a) { @@ -289,7 +283,6 @@ TEST_F(LivenessTest, Loop1) { } TEST_F(LivenessTest, Loop3) { - TEST_DISABLED_FOR_RISCV64(); // Test that the returned value stays live in a preceding loop. // var a = 0; // while (a == a) { @@ -337,7 +330,6 @@ TEST_F(LivenessTest, Loop3) { TEST_F(LivenessTest, Loop4) { - TEST_DISABLED_FOR_RISCV64(); // Make sure we support a preheader of a loop not being the first predecessor // in the predecessor list of the header. // var a = 0; @@ -390,7 +382,6 @@ TEST_F(LivenessTest, Loop4) { } TEST_F(LivenessTest, Loop5) { - TEST_DISABLED_FOR_RISCV64(); // Make sure we create a preheader of a loop when a header originally has two // incoming blocks and one back edge. // Bitsets are made of: @@ -447,7 +438,6 @@ TEST_F(LivenessTest, Loop5) { } TEST_F(LivenessTest, Loop6) { - TEST_DISABLED_FOR_RISCV64(); // Bitsets are made of: // (constant0, constant4, constant5, phi in block 2) const char* expected = @@ -499,7 +489,6 @@ TEST_F(LivenessTest, Loop6) { TEST_F(LivenessTest, Loop7) { - TEST_DISABLED_FOR_RISCV64(); // Bitsets are made of: // (constant0, constant4, constant5, phi in block 2, phi in block 6) const char* expected = @@ -554,7 +543,6 @@ TEST_F(LivenessTest, Loop7) { } TEST_F(LivenessTest, Loop8) { - TEST_DISABLED_FOR_RISCV64(); // var a = 0; // while (a == a) { // a = a + a; diff --git a/compiler/optimizing/loop_optimization_test.cc b/compiler/optimizing/loop_optimization_test.cc index 49e3c0418f..7f694fb655 100644 --- a/compiler/optimizing/loop_optimization_test.cc +++ b/compiler/optimizing/loop_optimization_test.cc @@ -30,7 +30,6 @@ namespace art HIDDEN { class LoopOptimizationTest : public OptimizingUnitTest { protected: void SetUp() override { - TEST_SETUP_DISABLED_FOR_RISCV64(); OptimizingUnitTest::SetUp(); graph_ = CreateGraph(); @@ -45,7 +44,6 @@ class LoopOptimizationTest : public OptimizingUnitTest { } void TearDown() override { - TEST_TEARDOWN_DISABLED_FOR_RISCV64(); codegen_.reset(); compiler_options_.reset(); graph_ = nullptr; @@ -136,20 +134,17 @@ class LoopOptimizationTest : public OptimizingUnitTest { // TEST_F(LoopOptimizationTest, NoLoops) { - TEST_DISABLED_FOR_RISCV64(); PerformAnalysis(); EXPECT_EQ("", LoopStructure()); } TEST_F(LoopOptimizationTest, SingleLoop) { - TEST_DISABLED_FOR_RISCV64(); AddLoop(entry_block_, return_block_); PerformAnalysis(); EXPECT_EQ("[]", LoopStructure()); } TEST_F(LoopOptimizationTest, LoopNest10) { - TEST_DISABLED_FOR_RISCV64(); HBasicBlock* b = entry_block_; HBasicBlock* s = return_block_; for (int i = 0; i < 10; i++) { @@ -161,7 +156,6 @@ TEST_F(LoopOptimizationTest, LoopNest10) { } TEST_F(LoopOptimizationTest, LoopSequence10) { - TEST_DISABLED_FOR_RISCV64(); HBasicBlock* b = entry_block_; HBasicBlock* s = return_block_; for (int i = 0; i < 10; i++) { @@ -173,7 +167,6 @@ TEST_F(LoopOptimizationTest, LoopSequence10) { } TEST_F(LoopOptimizationTest, LoopSequenceOfNests) { - TEST_DISABLED_FOR_RISCV64(); HBasicBlock* b = entry_block_; HBasicBlock* s = return_block_; for (int i = 0; i < 10; i++) { @@ -201,7 +194,6 @@ TEST_F(LoopOptimizationTest, LoopSequenceOfNests) { } TEST_F(LoopOptimizationTest, LoopNestWithSequence) { - TEST_DISABLED_FOR_RISCV64(); HBasicBlock* b = entry_block_; HBasicBlock* s = return_block_; for (int i = 0; i < 10; i++) { @@ -223,7 +215,6 @@ TEST_F(LoopOptimizationTest, LoopNestWithSequence) { // // This is a test for nodes.cc functionality - HGraph::SimplifyLoop. TEST_F(LoopOptimizationTest, SimplifyLoopReoderPredecessors) { - TEST_DISABLED_FOR_RISCV64(); // Can't use AddLoop as we want special order for blocks predecessors. HBasicBlock* header = new (GetAllocator()) HBasicBlock(graph_); HBasicBlock* body = new (GetAllocator()) HBasicBlock(graph_); @@ -269,7 +260,6 @@ TEST_F(LoopOptimizationTest, SimplifyLoopReoderPredecessors) { // // This is a test for nodes.cc functionality - HGraph::SimplifyLoop. TEST_F(LoopOptimizationTest, SimplifyLoopSinglePreheader) { - TEST_DISABLED_FOR_RISCV64(); HBasicBlock* header = AddLoop(entry_block_, return_block_); header->InsertInstructionBefore( diff --git a/compiler/optimizing/ssa_liveness_analysis_test.cc b/compiler/optimizing/ssa_liveness_analysis_test.cc index 18c945381d..2df0f34c7d 100644 --- a/compiler/optimizing/ssa_liveness_analysis_test.cc +++ b/compiler/optimizing/ssa_liveness_analysis_test.cc @@ -31,7 +31,6 @@ namespace art HIDDEN { class SsaLivenessAnalysisTest : public OptimizingUnitTest { protected: void SetUp() override { - TEST_SETUP_DISABLED_FOR_RISCV64(); OptimizingUnitTest::SetUp(); graph_ = CreateGraph(); compiler_options_ = CommonCompilerTest::CreateCompilerOptions(kRuntimeISA, "default"); @@ -43,11 +42,6 @@ class SsaLivenessAnalysisTest : public OptimizingUnitTest { graph_->SetEntryBlock(entry_); } - void TearDown() override { - TEST_TEARDOWN_DISABLED_FOR_RISCV64(); - OptimizingUnitTest::TearDown(); - } - protected: HBasicBlock* CreateSuccessor(HBasicBlock* block) { HGraph* graph = block->GetGraph(); @@ -64,7 +58,6 @@ class SsaLivenessAnalysisTest : public OptimizingUnitTest { }; TEST_F(SsaLivenessAnalysisTest, TestReturnArg) { - TEST_DISABLED_FOR_RISCV64(); HInstruction* arg = new (GetAllocator()) HParameterValue( graph_->GetDexFile(), dex::TypeIndex(0), 0, DataType::Type::kInt32); entry_->AddInstruction(arg); @@ -85,7 +78,6 @@ TEST_F(SsaLivenessAnalysisTest, TestReturnArg) { } TEST_F(SsaLivenessAnalysisTest, TestAput) { - TEST_DISABLED_FOR_RISCV64(); HInstruction* array = new (GetAllocator()) HParameterValue( graph_->GetDexFile(), dex::TypeIndex(0), 0, DataType::Type::kReference); HInstruction* index = new (GetAllocator()) HParameterValue( @@ -155,7 +147,6 @@ TEST_F(SsaLivenessAnalysisTest, TestAput) { } TEST_F(SsaLivenessAnalysisTest, TestDeoptimize) { - TEST_DISABLED_FOR_RISCV64(); HInstruction* array = new (GetAllocator()) HParameterValue( graph_->GetDexFile(), dex::TypeIndex(0), 0, DataType::Type::kReference); HInstruction* index = new (GetAllocator()) HParameterValue( diff --git a/dex2oat/dex2oat_image_test.cc b/dex2oat/dex2oat_image_test.cc index 9ba540b973..e276638372 100644 --- a/dex2oat/dex2oat_image_test.cc +++ b/dex2oat/dex2oat_image_test.cc @@ -250,7 +250,6 @@ TEST_F(Dex2oatImageTest, TestModesAndFilters) { } TEST_F(Dex2oatImageTest, TestExtension) { - TEST_DISABLED_FOR_RISCV64(); std::string error_msg; MemMap reservation = ReserveCoreImageAddressSpace(&error_msg); ASSERT_TRUE(reservation.IsValid()) << error_msg; diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc index 9c6a381ac3..4a8a4f3c65 100644 --- a/dex2oat/dex2oat_test.cc +++ b/dex2oat/dex2oat_test.cc @@ -1498,7 +1498,6 @@ TEST_F(Dex2oatVerifierAbort, HardFail) { class Dex2oatDedupeCode : public Dex2oatTest {}; TEST_F(Dex2oatDedupeCode, DedupeTest) { - TEST_DISABLED_FOR_RISCV64(); // Use MyClassNatives. It has lots of native methods that will produce deduplicate-able code. std::unique_ptr<const DexFile> dex(OpenTestDexFile("MyClassNatives")); std::string out_dir = GetScratchDir(); diff --git a/dex2oat/driver/compiler_driver_test.cc b/dex2oat/driver/compiler_driver_test.cc index a82de055a9..759426a1d3 100644 --- a/dex2oat/driver/compiler_driver_test.cc +++ b/dex2oat/driver/compiler_driver_test.cc @@ -261,7 +261,6 @@ class CompilerDriverProfileTest : public CompilerDriverTest { }; TEST_F(CompilerDriverProfileTest, ProfileGuidedCompilation) { - TEST_DISABLED_FOR_RISCV64(); Thread* self = Thread::Current(); jobject class_loader; { diff --git a/dex2oat/verifier_deps_test.cc b/dex2oat/verifier_deps_test.cc index 0b72382b21..a1e93b750e 100644 --- a/dex2oat/verifier_deps_test.cc +++ b/dex2oat/verifier_deps_test.cc @@ -584,7 +584,6 @@ TEST_F(VerifierDepsTest, VerifyDeps) { } TEST_F(VerifierDepsTest, CompilerDriver) { - TEST_DISABLED_FOR_RISCV64(); SetupCompilerDriver(); // Test both multi-dex and single-dex configuration. diff --git a/imgdiag/imgdiag_test.cc b/imgdiag/imgdiag_test.cc index 3ea7093278..9dd7953a24 100644 --- a/imgdiag/imgdiag_test.cc +++ b/imgdiag/imgdiag_test.cc @@ -115,7 +115,6 @@ TEST_F(ImgDiagTest, ImageDiffPidSelf) { // because it's root read-only. TEST_F(ImgDiagTest, DISABLED_ImageDiffPidSelf) { #endif - TEST_DISABLED_FOR_RISCV64(); // Invoke 'img_diag' against the current process. // This should succeed because we have a runtime and so it should // be able to map in the boot.art and do a diff for it. diff --git a/libartbase/base/common_art_test.h b/libartbase/base/common_art_test.h index 64e251e16c..c490e085cd 100644 --- a/libartbase/base/common_art_test.h +++ b/libartbase/base/common_art_test.h @@ -339,24 +339,4 @@ std::vector<pid_t> GetPidByName(const std::string& process_name); GTEST_SKIP() << "WARNING: TEST DISABLED FOR MEMORY TOOL WITH HEAP POISONING"; \ } -#define TEST_DISABLED_FOR_RISCV64() \ - if (kRuntimeISA == InstructionSet::kRiscv64) { \ - GTEST_SKIP() << "WARNING: TEST DISABLED FOR RISCV64"; \ - } - -// Don't print messages on setup to avoid getting multiple "test disabled" messages for one test. -// Setup phase may need to be disabled as some test rely on having boot image / compiler / other -// things that are not implemented for RISC-V. -#define TEST_SETUP_DISABLED_FOR_RISCV64() \ - if (kRuntimeISA == InstructionSet::kRiscv64) { \ - GTEST_SKIP(); \ - } - -// Don't print messages on teardown to avoid getting multiple "test disabled" messages for one test. -// Teardown phase may need to be disabled to match the disabled setup phase for some tests. -#define TEST_TEARDOWN_DISABLED_FOR_RISCV64() \ - if (kRuntimeISA == InstructionSet::kRiscv64) { \ - GTEST_SKIP(); \ - } - #endif // ART_LIBARTBASE_BASE_COMMON_ART_TEST_H_ diff --git a/libartpalette/apex/palette_test.cc b/libartpalette/apex/palette_test.cc index c2b7304d8d..63072c491b 100644 --- a/libartpalette/apex/palette_test.cc +++ b/libartpalette/apex/palette_test.cc @@ -54,16 +54,10 @@ bool PaletteSetTaskProfilesIsSupported(palette_status_t res) { } // namespace -// TODO(riscv64): remove `namespace art` when `TEST_DISABLED_FOR_RISCV64` is no longer needed. -namespace art { - class PaletteClientTest : public testing::Test {}; TEST_F(PaletteClientTest, SchedPriority) { - // On RISC-V tests run in Android-like chroot on a Linux VM => some syscalls work differently. - TEST_DISABLED_FOR_RISCV64(); - - int32_t tid = ::GetTid(); + int32_t tid = GetTid(); int32_t saved_priority; EXPECT_EQ(PALETTE_STATUS_OK, PaletteSchedGetPriority(tid, &saved_priority)); @@ -87,9 +81,6 @@ TEST_F(PaletteClientTest, Ashmem) { #ifndef ART_TARGET_ANDROID GTEST_SKIP() << "ashmem is only supported on Android"; #else - // On RISC-V tests run in Android-like chroot on a Linux VM => some syscalls work differently. - TEST_DISABLED_FOR_RISCV64(); - int fd; EXPECT_EQ(PALETTE_STATUS_OK, PaletteAshmemCreateRegion("ashmem-test", 4096, &fd)); EXPECT_EQ(PALETTE_STATUS_OK, PaletteAshmemSetProtRegion(fd, PROT_READ | PROT_EXEC)); @@ -175,5 +166,3 @@ TEST_F(PaletteClientTest, SetTaskProfilesCpp) { } #endif } - -} // namespace art diff --git a/oatdump/oatdump_app_test.cc b/oatdump/oatdump_app_test.cc index 03b43cef11..d4dee4f2f6 100644 --- a/oatdump/oatdump_app_test.cc +++ b/oatdump/oatdump_app_test.cc @@ -20,7 +20,6 @@ namespace art { // Oat file compiled with a boot image. oatdump invoked with a boot image. TEST_P(OatDumpTest, TestDumpOatWithRuntimeWithBootImage) { - TEST_DISABLED_FOR_RISCV64(); ASSERT_TRUE(GenerateAppOdexFile(GetParam())); ASSERT_TRUE(Exec(GetParam(), kArgOatApp | kArgBootImage | kArgBcp | kArgIsa, @@ -30,7 +29,6 @@ TEST_P(OatDumpTest, TestDumpOatWithRuntimeWithBootImage) { // Oat file compiled without a boot image. oatdump invoked without a boot image. TEST_P(OatDumpTest, TestDumpOatWithRuntimeWithNoBootImage) { - TEST_DISABLED_FOR_RISCV64(); TEST_DISABLED_FOR_DEBUG_BUILD(); // DCHECK failed. ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {"--boot-image=/nonx/boot.art"})); ASSERT_TRUE(Exec(GetParam(), @@ -41,7 +39,6 @@ TEST_P(OatDumpTest, TestDumpOatWithRuntimeWithNoBootImage) { // Dex code cannot be found in the vdex file, and no --dex-file is specified. Dump header only. TEST_P(OatDumpTest, TestDumpOatTryWithRuntimeDexNotFound) { - TEST_DISABLED_FOR_RISCV64(); ASSERT_TRUE( GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"})); ASSERT_TRUE(Exec(GetParam(), kArgOatApp | kArgBootImage | kArgBcp | kArgIsa, {}, kExpectOat)); @@ -49,7 +46,6 @@ TEST_P(OatDumpTest, TestDumpOatTryWithRuntimeDexNotFound) { // Dex code cannot be found in the vdex file, but can be found in the specified dex file. TEST_P(OatDumpTest, TestDumpOatWithRuntimeDexSpecified) { - TEST_DISABLED_FOR_RISCV64(); ASSERT_TRUE( GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"})); ASSERT_TRUE(Exec(GetParam(), @@ -60,7 +56,6 @@ TEST_P(OatDumpTest, TestDumpOatWithRuntimeDexSpecified) { // Oat file compiled with a boot image. oatdump invoked without a boot image. TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeBcpMismatch) { - TEST_DISABLED_FOR_RISCV64(); ASSERT_TRUE(GenerateAppOdexFile(GetParam())); ASSERT_TRUE(Exec(GetParam(), kArgOatApp | kArgBcp | kArgIsa, @@ -70,14 +65,12 @@ TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeBcpMismatch) { // Bootclasspath not specified. TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeNoBcp) { - TEST_DISABLED_FOR_RISCV64(); ASSERT_TRUE(GenerateAppOdexFile(GetParam())); ASSERT_TRUE(Exec(GetParam(), kArgOatApp, {}, kExpectOat | kExpectCode | kExpectBssOffsetsForBcp)); } // Dex code cannot be found in the vdex file, and no --dex-file is specified. Dump header only. TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeDexNotFound) { - TEST_DISABLED_FOR_RISCV64(); ASSERT_TRUE( GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"})); ASSERT_TRUE(Exec(GetParam(), kArgOatApp, {}, kExpectOat)); @@ -85,7 +78,6 @@ TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeDexNotFound) { // Dex code cannot be found in the vdex file, but can be found in the specified dex file. TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeDexSpecified) { - TEST_DISABLED_FOR_RISCV64(); ASSERT_TRUE( GenerateAppOdexFile(GetParam(), {"--dex-location=/nonx/app.jar", "--copy-dex-files=false"})); ASSERT_TRUE(Exec( @@ -93,7 +85,6 @@ TEST_P(OatDumpTest, TestDumpOatWithoutRuntimeDexSpecified) { } TEST_P(OatDumpTest, TestDumpAppImageWithBootImage) { - TEST_DISABLED_FOR_RISCV64(); TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS(); // GC bug, b/126305867 const std::string app_image_arg = "--app-image-file=" + GetAppImageName(); ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {app_image_arg})); @@ -105,7 +96,6 @@ TEST_P(OatDumpTest, TestDumpAppImageWithBootImage) { // Deprecated usage, but checked for compatibility. TEST_P(OatDumpTest, TestDumpAppImageWithBootImageLegacy) { - TEST_DISABLED_FOR_RISCV64(); TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS(); // GC bug, b/126305867 const std::string app_image_arg = "--app-image-file=" + GetAppImageName(); ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {app_image_arg})); @@ -116,7 +106,6 @@ TEST_P(OatDumpTest, TestDumpAppImageWithBootImageLegacy) { } TEST_P(OatDumpTest, TestDumpAppImageInvalidPath) { - TEST_DISABLED_FOR_RISCV64(); TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS(); // GC bug, b/126305867 const std::string app_image_arg = "--app-image-file=" + GetAppImageName(); ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {app_image_arg})); @@ -129,7 +118,6 @@ TEST_P(OatDumpTest, TestDumpAppImageInvalidPath) { // The runtime can start, but the boot image check should fail. TEST_P(OatDumpTest, TestDumpAppImageWithWrongBootImage) { - TEST_DISABLED_FOR_RISCV64(); TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS(); // GC bug, b/126305867 const std::string app_image_arg = "--app-image-file=" + GetAppImageName(); ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {app_image_arg})); @@ -142,7 +130,6 @@ TEST_P(OatDumpTest, TestDumpAppImageWithWrongBootImage) { // Not possible. TEST_P(OatDumpTest, TestDumpAppImageWithoutRuntime) { - TEST_DISABLED_FOR_RISCV64(); TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS(); // GC bug, b/126305867 const std::string app_image_arg = "--app-image-file=" + GetAppImageName(); ASSERT_TRUE(GenerateAppOdexFile(GetParam(), {app_image_arg})); @@ -155,7 +142,6 @@ TEST_P(OatDumpTest, TestDumpAppImageWithoutRuntime) { // Dex code cannot be found in the vdex file, and no --dex-file is specified. Cannot dump app image. TEST_P(OatDumpTest, TestDumpAppImageDexNotFound) { - TEST_DISABLED_FOR_RISCV64(); TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS(); // GC bug, b/126305867 const std::string app_image_arg = "--app-image-file=" + GetAppImageName(); ASSERT_TRUE(GenerateAppOdexFile( @@ -169,7 +155,6 @@ TEST_P(OatDumpTest, TestDumpAppImageDexNotFound) { // Dex code cannot be found in the vdex file, but can be found in the specified dex file. TEST_P(OatDumpTest, TestDumpAppImageDexSpecified) { - TEST_DISABLED_FOR_RISCV64(); TEST_DISABLED_WITHOUT_BAKER_READ_BARRIERS(); // GC bug, b/126305867 const std::string app_image_arg = "--app-image-file=" + GetAppImageName(); ASSERT_TRUE(GenerateAppOdexFile( diff --git a/oatdump/oatdump_test.cc b/oatdump/oatdump_test.cc index 88cd044a48..6cd3a9742a 100644 --- a/oatdump/oatdump_test.cc +++ b/oatdump/oatdump_test.cc @@ -66,10 +66,10 @@ TEST_P(OatDumpTest, TestListMethods) { } TEST_P(OatDumpTest, TestSymbolize) { - TEST_DISABLED_FOR_RISCV64(); if (GetParam() == Flavor::kDynamic) { TEST_DISABLED_FOR_TARGET(); // Can not write files inside the apex directory. } else { + TEST_DISABLED_FOR_RISCV64(); TEST_DISABLED_FOR_ARM_AND_ARM64(); } std::string error_msg; @@ -77,8 +77,8 @@ TEST_P(OatDumpTest, TestSymbolize) { } TEST_P(OatDumpTest, TestExportDex) { - TEST_DISABLED_FOR_RISCV64(); if (GetParam() == Flavor::kStatic) { + TEST_DISABLED_FOR_RISCV64(); TEST_DISABLED_FOR_ARM_AND_ARM64(); } std::string error_msg; diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h index 0f164a7d07..8f9d7a80ff 100644 --- a/runtime/common_runtime_test.h +++ b/runtime/common_runtime_test.h @@ -283,6 +283,11 @@ class CheckJniAbortCatcher { GTEST_SKIP() << "WARNING: TEST DISABLED FOR ARM64"; \ } +#define TEST_DISABLED_FOR_RISCV64() \ + if (kRuntimeISA == InstructionSet::kRiscv64) { \ + GTEST_SKIP() << "WARNING: TEST DISABLED FOR RISCV64"; \ + } + #define TEST_DISABLED_FOR_X86() \ if (kRuntimeISA == InstructionSet::kX86) { \ GTEST_SKIP() << "WARNING: TEST DISABLED FOR X86"; \ diff --git a/runtime/gc/space/image_space_test.cc b/runtime/gc/space/image_space_test.cc index 4f6c4e9633..2979544d90 100644 --- a/runtime/gc/space/image_space_test.cc +++ b/runtime/gc/space/image_space_test.cc @@ -432,7 +432,6 @@ class ImageSpaceLoadingSingleComponentWithProfilesTest TEST_F(ImageSpaceLoadingSingleComponentWithProfilesTest, Test) { // Compiling the primary boot image into a single image is not allowed on host. TEST_DISABLED_FOR_HOST(); - TEST_DISABLED_FOR_RISCV64(); CheckImageSpaceAndOatFile(/*space_count=*/1); } @@ -487,7 +486,6 @@ class ImageSpaceLoadingMultipleComponentsWithProfilesTest TEST_F(ImageSpaceLoadingMultipleComponentsWithProfilesTest, Test) { // Compiling the primary boot image into a single image is not allowed on host. TEST_DISABLED_FOR_HOST(); - TEST_DISABLED_FOR_RISCV64(); CheckImageSpaceAndOatFile(/*space_count=*/1); } diff --git a/runtime/oat/elf_file.cc b/runtime/oat/elf_file.cc index 96d7d0f4ac..30e0197470 100644 --- a/runtime/oat/elf_file.cc +++ b/runtime/oat/elf_file.cc @@ -1082,6 +1082,8 @@ static InstructionSet GetInstructionSetFromELF(uint16_t e_machine, return InstructionSet::kArm; case EM_AARCH64: return InstructionSet::kArm64; + case EM_RISCV: + return InstructionSet::kRiscv64; case EM_386: return InstructionSet::kX86; case EM_X86_64: |