| 74 | struct CompiledWithoutSupportOptions {} |
| 75 | |
| 76 | fn main() -> anyhow::Result<()> { |
| 77 | env_logger::init(); |
| 78 | |
| 79 | match Commands::parse() { |
| 80 | Commands::Cat(c) => cat::run(&c)?, |
| 81 | Commands::Run(r) => run::run(&r)?, |
| 82 | Commands::Interpret(i) => interpret::run(&i)?, |
| 83 | Commands::PrintCfg(p) => print_cfg::run(&p)?, |
| 84 | Commands::Compile(c) => compile::run(&c)?, |
| 85 | Commands::Bugpoint(b) => bugpoint::run(&b)?, |
| 86 | |
| 87 | #[cfg(feature = "souper-harvest")] |
| 88 | Commands::SouperHarvest(s) => souper_harvest::run(&s)?, |
| 89 | #[cfg(not(feature = "souper-harvest"))] |
| 90 | Commands::SouperHarvest(_) => anyhow::bail!( |
| 91 | "Error: clif-util was compiled without support for the `souper-harvest` \ |
| 92 | subcommand", |
| 93 | ), |
| 94 | |
| 95 | Commands::Test(t) => { |
| 96 | cranelift_filetests::run( |
| 97 | t.verbose, |
| 98 | t.time_passes, |
| 99 | &t.files |
| 100 | .iter() |
| 101 | .map(|f| f.display().to_string()) |
| 102 | .collect::<Vec<_>>(), |
| 103 | )?; |
| 104 | } |
| 105 | Commands::Pass(p) => { |
| 106 | cranelift_filetests::run_passes( |
| 107 | p.verbose, |
| 108 | p.time_passes, |
| 109 | &p.passes, |
| 110 | &p.target, |
| 111 | &p.file.display().to_string(), |
| 112 | )?; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | Ok(()) |
| 117 | } |
| 118 | |
| 119 | #[test] |
| 120 | fn verify_cli() { |