diff options
Diffstat (limited to 'backend/unittests/Tooling')
| -rw-r--r-- | backend/unittests/Tooling/MIRReducerFuzzerTest.cpp | 2 | ||||
| -rw-r--r-- | backend/unittests/Tooling/PipelineDriverTest.cpp | 15 |
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 = |
