From 6a7b083f322f4ac47e58cbf9d4d5fd4d1f6fecd0 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Tue, 11 Aug 2026 17:37:42 +0800 Subject: [MIR] Accept fixed-baseline LLVM syntax --- backend/unittests/Tooling/PipelineDriverTest.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'backend/unittests/Tooling/PipelineDriverTest.cpp') diff --git a/backend/unittests/Tooling/PipelineDriverTest.cpp b/backend/unittests/Tooling/PipelineDriverTest.cpp index 4a223b6..b9180ce 100644 --- a/backend/unittests/Tooling/PipelineDriverTest.cpp +++ b/backend/unittests/Tooling/PipelineDriverTest.cpp @@ -214,6 +214,21 @@ int main() { if (rcc::tooling::runRV64GCPipeline(MixedInput->Document, *Target, MixedPipeline)) return tooling_test::fail("named passes must not be mixed with the default pipeline marker"); + rcc::tooling::BackendInvocation NoPassInvocation = Invocation; + NoPassInvocation.PassPipeline = {"none"}; + auto NoPassInput = rcc::tooling::parseAndCanonicalizeMIR( + "no-pass.mir", *Source, *Target, NoPassInvocation); + if (!NoPassInput) + return tooling_test::fail(NoPassInput.error().message()); + const std::string NoPassExpected = NoPassInput->Text; + auto NoPassRun = rcc::tooling::runBackend( + std::move(*NoPassInput), *Target, NoPassInvocation, + rcc::tooling::BackendOutputKind::FinalMIR); + if (!NoPassRun || !NoPassRun->Pipeline.ExecutedPasses.empty() || + NoPassRun->text() != NoPassExpected) { + return tooling_test::fail("the LLVM-compatible none pass must preserve canonical MIR"); + } + if (!SelectedMIR) return tooling_test::fail("selected MIR stage was not captured"); auto LaterInput = -- cgit v1.2.3