aboutsummaryrefslogtreecommitdiff
path: root/backend/unittests/Tooling
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-11 17:37:42 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-11 17:37:42 +0800
commit6a7b083f322f4ac47e58cbf9d4d5fd4d1f6fecd0 (patch)
treef363c502f0e2b9cda2f12928049275a433db6ad4 /backend/unittests/Tooling
parentadcf8c9b1bd1b47e00bf859693112cea1f7e8c9f (diff)
downloadrcc-project-6a7b083f322f4ac47e58cbf9d4d5fd4d1f6fecd0.tar.gz
rcc-project-6a7b083f322f4ac47e58cbf9d4d5fd4d1f6fecd0.tar.xz
[MIR] Accept fixed-baseline LLVM syntax
Diffstat (limited to 'backend/unittests/Tooling')
-rw-r--r--backend/unittests/Tooling/MIRReducerFuzzerTest.cpp2
-rw-r--r--backend/unittests/Tooling/PipelineDriverTest.cpp15
2 files changed, 16 insertions, 1 deletions
diff --git a/backend/unittests/Tooling/MIRReducerFuzzerTest.cpp b/backend/unittests/Tooling/MIRReducerFuzzerTest.cpp
index 236f4e9..9c95d75 100644
--- a/backend/unittests/Tooling/MIRReducerFuzzerTest.cpp
+++ b/backend/unittests/Tooling/MIRReducerFuzzerTest.cpp
@@ -36,7 +36,7 @@ namespace {
return rcc::makeUnexpected(rcc::ErrorCode::InternalError,
"test MIR does not contain the expected COPY");
}
- Source.insert(Position, " %3:gpr(i64) = G_CONSTANT 99\n");
+ Source.insert(Position, " %3:gprb(i64) = G_CONSTANT 99\n");
return Source;
}
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 =