aboutsummaryrefslogtreecommitdiff
path: root/backend/unittests
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-12 03:36:43 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-12 03:36:43 +0800
commit165082bbec7097bc8385e10a2a6fcb6bdf7be75a (patch)
treef5aa01578bfca6f18c4f568ba0c5e6ec26df8141 /backend/unittests
parentce691f04c3eb1a972419187884f926de9632b7cf (diff)
downloadrcc-project-165082bbec7097bc8385e10a2a6fcb6bdf7be75a.tar.gz
rcc-project-165082bbec7097bc8385e10a2a6fcb6bdf7be75a.tar.xz
[CodeGen] Allow dynamic implicit operands on copies
Diffstat (limited to 'backend/unittests')
-rw-r--r--backend/unittests/CodeGen/GenericOpcodesTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/backend/unittests/CodeGen/GenericOpcodesTest.cpp b/backend/unittests/CodeGen/GenericOpcodesTest.cpp
index 26f7442..6240c6d 100644
--- a/backend/unittests/CodeGen/GenericOpcodesTest.cpp
+++ b/backend/unittests/CodeGen/GenericOpcodesTest.cpp
@@ -263,11 +263,16 @@ void testCoreOpcodeContracts(TestContext &Context) {
const auto InlineAsmBr = std::ranges::find_if(Descriptors, [](const auto &Descriptor) {
return Descriptor.InstructionOpcode == rcc::opcode(rcc::GenericOpcode::INLINEASM_BR);
});
+ const auto Copy = std::ranges::find_if(Descriptors, [](const auto &Descriptor) {
+ return Descriptor.InstructionOpcode == rcc::opcode(rcc::GenericOpcode::COPY);
+ });
Context.expect(InlineAsm != Descriptors.end() && InlineAsmBr != Descriptors.end() &&
!InlineAsm->Flags.has(rcc::InstructionFlag::HasSideEffects) &&
InlineAsmBr->Flags.has(rcc::InstructionFlag::HasSideEffects),
"INLINEASM_BR must be intrinsically side-effecting while INLINEASM uses its "
"operand flags");
+ Context.expect(Copy != Descriptors.end() && Copy->AllowExtraImplicitOperands,
+ "COPY must allow dynamic implicit super-register operands");
}
void testShapesAndTypes(TestContext &Context) {