Run verifier after legalizer and regalloc file tests.
Run the verify_contexti() function after invoking the legalize() and regalloc() context functions. This will help catch bad code produced by these passes.
This commit is contained in:
@@ -5,11 +5,12 @@
|
||||
//!
|
||||
//! The resulting function is sent to `filecheck`.
|
||||
|
||||
use std::borrow::Cow;
|
||||
use cretonne::{self, write_function};
|
||||
use cretonne::ir::Function;
|
||||
use cretonne::{self, write_function};
|
||||
use cton_reader::TestCommand;
|
||||
use filetest::subtest::{SubTest, Context, Result, run_filecheck};
|
||||
use std::borrow::Cow;
|
||||
use utils::pretty_verifier_error;
|
||||
|
||||
struct TestRegalloc;
|
||||
|
||||
@@ -46,6 +47,7 @@ impl SubTest for TestRegalloc {
|
||||
// TODO: Should we have an option to skip legalization?
|
||||
comp_ctx.legalize(isa);
|
||||
comp_ctx.regalloc(isa);
|
||||
comp_ctx.verify(isa).map_err(|e| pretty_verifier_error(&comp_ctx.func, e))?;
|
||||
|
||||
let mut text = String::new();
|
||||
write_function(&mut text, &comp_ctx.func, Some(isa)).map_err(|e| e.to_string())?;
|
||||
|
||||
Reference in New Issue
Block a user