aboutsummaryrefslogtreecommitdiff
path: root/backend/unittests/CodeGen/MachineFunctionClonerTest.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-12 01:16:51 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-12 01:16:51 +0800
commit785805863cbee537ba1e963ff177265171801aeb (patch)
treeee41c41ac49ebc401b28d027521d3b510051de47 /backend/unittests/CodeGen/MachineFunctionClonerTest.cpp
parent2ce605211c05039131cc828bee9906996f4a1acf (diff)
downloadrcc-project-785805863cbee537ba1e963ff177265171801aeb.tar.gz
rcc-project-785805863cbee537ba1e963ff177265171801aeb.tar.xz
[CodeGen] Test cloning unnamed functions
Diffstat (limited to 'backend/unittests/CodeGen/MachineFunctionClonerTest.cpp')
-rw-r--r--backend/unittests/CodeGen/MachineFunctionClonerTest.cpp10
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;