diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-12 01:16:51 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-12 01:16:51 +0800 |
| commit | 785805863cbee537ba1e963ff177265171801aeb (patch) | |
| tree | ee41c41ac49ebc401b28d027521d3b510051de47 | |
| parent | 2ce605211c05039131cc828bee9906996f4a1acf (diff) | |
| download | rcc-project-785805863cbee537ba1e963ff177265171801aeb.tar.gz rcc-project-785805863cbee537ba1e963ff177265171801aeb.tar.xz | |
[CodeGen] Test cloning unnamed functions
| -rw-r--r-- | backend/unittests/CodeGen/MachineFunctionClonerTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp b/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp index 9d8ffd2..e923108 100644 --- a/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp +++ b/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp @@ -800,11 +800,11 @@ void testCloneFailures(TestContext &Context) { rcc::MachineFunctionCloneOptions{ rcc::MachineFunctionStableID::fromValue(0), std::nullopt}), "clone must reject an invalid destination StableID"); - Context.expect( - !rcc::cloneMachineFunction(*Source, *Target, - rcc::MachineFunctionCloneOptions{ - rcc::MachineFunctionStableID::fromValue(3), std::string()}), - "clone must reject an explicitly empty destination name"); + auto EmptyName = rcc::cloneMachineFunction( + *Source, *Target, + rcc::MachineFunctionCloneOptions{rcc::MachineFunctionStableID::fromValue(3), std::string()}); + Context.expect(EmptyName && EmptyName->ClonedFunction->name().empty(), + "clone must preserve an explicitly empty destination name"); auto Invalid = createFunction(Context, "invalid_source", 4); rcc::MachineBasicBlock *Block = Invalid ? createBlock(Context, *Invalid) : nullptr; |
