Add test run to cranelift-filetests to allow executing CLIF (#890)

* Add ability to run CLIF IR using `clif-util run [-v] {file}` and add `test run` to cranelift-filetests to allow executing CLIF

This re-factors the compile/execute parts to a FunctionRunner that is shared between cranelift-filetests and clif-util. CLIF can be now be run using `clif-util run` as well as during `clif-util test` for files with a `test run` header. As before, only functions suffixed with a `run` comment are executed. The `run: fn(...) == ...` expression syntax is left for a subsequent change.
This commit is contained in:
Andrew Brown
2019-08-21 09:03:09 -07:00
committed by Benjamin Bouvier
parent 276bb5e26d
commit ff3c44385c
10 changed files with 330 additions and 2 deletions

View File

@@ -23,6 +23,7 @@
)
)]
pub use crate::function_runner::FunctionRunner;
use crate::runner::TestRunner;
use cranelift_codegen::timing;
use cranelift_reader::TestCommand;
@@ -30,6 +31,7 @@ use std::path::Path;
use std::time;
mod concurrent;
mod function_runner;
mod match_directive;
mod runner;
mod runone;
@@ -46,6 +48,7 @@ mod test_postopt;
mod test_preopt;
mod test_print_cfg;
mod test_regalloc;
mod test_run;
mod test_safepoint;
mod test_shrink;
mod test_simple_gvn;
@@ -124,6 +127,7 @@ fn new_subtest(parsed: &TestCommand) -> subtest::SubtestResult<Box<dyn subtest::
"simple_preopt" => test_simple_preopt::subtest(parsed),
"print-cfg" => test_print_cfg::subtest(parsed),
"regalloc" => test_regalloc::subtest(parsed),
"run" => test_run::subtest(parsed),
"shrink" => test_shrink::subtest(parsed),
"simple-gvn" => test_simple_gvn::subtest(parsed),
"verifier" => test_verifier::subtest(parsed),