aboutsummaryrefslogtreecommitdiff
path: root/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-03 19:24:30 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-03 19:24:30 +0800
commit432efe39315ed5ad0162f9c08dbf10941bc21dc1 (patch)
tree46622290cabfaeb8f4db1729aca6f0725739e08c /backend/unittests/CodeGen/MachineFunctionClonerTest.cpp
parent6580ac1c05bd1cbccd2dcd71fd9c2a384ae3db56 (diff)
downloadrcc-project-432efe39315ed5ad0162f9c08dbf10941bc21dc1.tar.gz
rcc-project-432efe39315ed5ad0162f9c08dbf10941bc21dc1.tar.xz
[CodeGen] Add target MIR text schema
Diffstat (limited to 'backend/unittests/CodeGen/MachineFunctionClonerTest.cpp')
-rw-r--r--backend/unittests/CodeGen/MachineFunctionClonerTest.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp b/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp
index d330f6a..a019c8b 100644
--- a/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp
+++ b/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp
@@ -268,6 +268,7 @@ createFunction(TestContext &Context, std::string Name, std::uint64_t ID) {
Description.Align = *rcc::Alignment::create(8);
Description.Base = std::move(Base);
Description.Offset = -8;
+ Description.TargetFlags = 0x3;
return Description;
}
@@ -383,7 +384,8 @@ struct SourceFixture final {
const auto RegClass = rcc::RegisterClassID::fromValue(2);
for (const rcc::Register Reg : {Fixture.Value, Fixture.CopyValue}) {
Context.expect(Function.registerInfo().setRegisterBank(Reg, Bank).has_value() &&
- Function.registerInfo().setRegisterClass(Reg, RegClass).has_value(),
+ Function.registerInfo().setRegisterClass(Reg, RegClass).has_value() &&
+ Function.registerInfo().setTargetRegisterFlags(Reg, 0x3).has_value(),
"source vreg constraints must be recorded");
}
@@ -591,7 +593,8 @@ void testDeepClone(TestContext &Context) {
SourceInfo->get().Type == DestinationInfo->get().Type &&
SourceInfo->get().Bank == DestinationInfo->get().Bank &&
SourceInfo->get().RegClass == DestinationInfo->get().RegClass &&
- SourceInfo->get().AllocationHints == DestinationInfo->get().AllocationHints,
+ SourceInfo->get().AllocationHints == DestinationInfo->get().AllocationHints &&
+ SourceInfo->get().TargetFlags == DestinationInfo->get().TargetFlags,
"clone must preserve vreg type and allocation constraints");
Context.expect(Destination.registerInfo().liveIns().size() == 1 &&
Destination.registerInfo().liveIns()[0].InitialVirtualRegister == NewValue &&