summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler_test_base.h
diff options
context:
space:
mode:
author Lifang Xia <lifang_xia@linux.alibaba.com> 2023-03-15 13:36:40 +0800
committer VladimĂ­r Marko <vmarko@google.com> 2023-05-02 17:00:03 +0000
commit60fdcb2b277e878eb3b2326ec516fe5d3d801174 (patch)
tree60d38cf458b74e218d178ebde56482aff17ae991 /compiler/utils/assembler_test_base.h
parent66a77df367635ee087809d9de04bc87a75e42f83 (diff)
Add assembler for riscv64, part 1.
Test: m test-art-host-gtest Bug: 271573990 Signed-off-by: Lifang Xia <lifang_xia@linux.alibaba.com> Signed-off-by: Wendong Wang <wangwd@xcvmbyte.com> Signed-off-by: Cao Xia <caoxia@eswincomputing.com> Change-Id: Ie1306521b8df28173b9be40f754e114bd849985b
Diffstat (limited to 'compiler/utils/assembler_test_base.h')
-rw-r--r--compiler/utils/assembler_test_base.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/utils/assembler_test_base.h b/compiler/utils/assembler_test_base.h
index 73f3657413..8b76643e98 100644
--- a/compiler/utils/assembler_test_base.h
+++ b/compiler/utils/assembler_test_base.h
@@ -141,6 +141,9 @@ class AssemblerTestBase : public testing::Test {
virtual std::vector<std::string> GetAssemblerCommand() {
InstructionSet isa = GetIsa();
switch (isa) {
+ case InstructionSet::kRiscv64:
+ // TODO: Support compression (RV32C) in assembler and tests (add `c` to `-march=`).
+ return {FindTool("clang"), "--compile", "-target", "riscv64-linux-gnu", "-march=rv64imafd"};
case InstructionSet::kX86:
return {FindTool("clang"), "--compile", "-target", "i386-linux-gnu"};
case InstructionSet::kX86_64:
@@ -159,6 +162,13 @@ class AssemblerTestBase : public testing::Test {
"--no-print-imm-hex",
"--triple",
"thumbv7a-linux-gnueabi"};
+ case InstructionSet::kRiscv64:
+ return {FindTool("llvm-objdump"),
+ "--disassemble",
+ "--no-print-imm-hex",
+ "--no-show-raw-insn",
+ "-M",
+ "no-aliases"};
default:
return {
FindTool("llvm-objdump"), "--disassemble", "--no-print-imm-hex", "--no-show-raw-insn"};