aboutsummaryrefslogtreecommitdiff
path: root/backend/unittests/Target/RISCVTargetTest.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-12 02:39:11 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-12 02:39:11 +0800
commit46db486c089e9c2d6b05287476d7975723929acf (patch)
tree922b87bc316cbc151dda94f4eaa23ec23d3e2547 /backend/unittests/Target/RISCVTargetTest.cpp
parent705ebca5d37ee30e9cd517fed5f09dbf12113e6b (diff)
downloadrcc-project-46db486c089e9c2d6b05287476d7975723929acf.tar.gz
rcc-project-46db486c089e9c2d6b05287476d7975723929acf.tar.xz
[RISCV] Make call-preserved masks optional
Diffstat (limited to 'backend/unittests/Target/RISCVTargetTest.cpp')
-rw-r--r--backend/unittests/Target/RISCVTargetTest.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/backend/unittests/Target/RISCVTargetTest.cpp b/backend/unittests/Target/RISCVTargetTest.cpp
index 2515201..555db4c 100644
--- a/backend/unittests/Target/RISCVTargetTest.cpp
+++ b/backend/unittests/Target/RISCVTargetTest.cpp
@@ -188,6 +188,8 @@ void testInstructionFacts(TestContext &Context) {
const auto *GenericAdd = Target->instructionDescriptor(rcc::opcode(rcc::GenericOpcode::G_ADD));
const auto *PseudoCall = Target->instructionDescriptor(rcc::Opcode::fromValue(
static_cast<std::uint32_t>(rcc::riscv::InstructionOpcode::PseudoCALL)));
+ const auto *PseudoTail = Target->instructionDescriptor(rcc::Opcode::fromValue(
+ static_cast<std::uint32_t>(rcc::riscv::InstructionOpcode::PseudoTAIL)));
const auto *Assembly = rcc::riscv::assemblyInstruction(
rcc::Opcode::fromValue(static_cast<std::uint32_t>(rcc::riscv::InstructionOpcode::ADDI)));
const auto *FenceAssembly = rcc::riscv::assemblyInstruction(
@@ -239,7 +241,9 @@ void testInstructionFacts(TestContext &Context) {
Compressed != nullptr && Compressed->ImplicitDefs.size() == 1 &&
Compressed->ImplicitUses.size() == 1 && GenericAdd != nullptr &&
GenericAdd->Flags.has(rcc::InstructionFlag::Generic) && PseudoCall != nullptr &&
- PseudoCall->Flags.has(rcc::InstructionFlag::Pseudo) &&
+ PseudoCall->Operands.size() == 2 && PseudoCall->Operands[1].Optional &&
+ PseudoTail != nullptr && PseudoTail->Operands.size() == 2 &&
+ PseudoTail->Operands[1].Optional && PseudoCall->Flags.has(rcc::InstructionFlag::Pseudo) &&
PseudoCall->Flags.has(rcc::InstructionFlag::Call) &&
rcc::riscv::assemblyInstruction(PseudoCall->InstructionOpcode) == nullptr &&
Assembly != nullptr && Assembly->Mnemonic == "addi" &&