From 165082bbec7097bc8385e10a2a6fcb6bdf7be75a Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Wed, 12 Aug 2026 03:36:43 +0800 Subject: [CodeGen] Allow dynamic implicit operands on copies --- backend/unittests/CodeGen/GenericOpcodesTest.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backend/unittests/CodeGen') 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) { -- cgit v1.2.3