Create a new subcommand trait object to match `parsed.command`. This function knows how to create all of the possible `test ` commands that can appear in a `.clif` test file.
(parsed: &TestCommand)
| 85 | /// This function knows how to create all of the possible `test <foo>` commands that can appear in |
| 86 | /// a `.clif` test file. |
| 87 | fn new_subtest(parsed: &TestCommand) -> anyhow::Result<Box<dyn subtest::SubTest>> { |
| 88 | match parsed.command { |
| 89 | "alias-analysis" => test_alias_analysis::subtest(parsed), |
| 90 | "cat" => test_cat::subtest(parsed), |
| 91 | "compile" => test_compile::subtest(parsed), |
| 92 | "domtree" => test_domtree::subtest(parsed), |
| 93 | "inline" => test_inline::subtest(parsed), |
| 94 | "interpret" => test_interpret::subtest(parsed), |
| 95 | "legalizer" => test_legalizer::subtest(parsed), |
| 96 | "optimize" => test_optimize::subtest(parsed), |
| 97 | "print-cfg" => test_print_cfg::subtest(parsed), |
| 98 | "run" => test_run::subtest(parsed), |
| 99 | "safepoint" => test_safepoint::subtest(parsed), |
| 100 | "unwind" => test_unwind::subtest(parsed), |
| 101 | "verifier" => test_verifier::subtest(parsed), |
| 102 | _ => anyhow::bail!("unknown test command '{}'", parsed.command), |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | fn pretty_anyhow_error( |
| 107 | func: &cranelift_codegen::ir::Function, |