Use capstone to validate precise-output tests (#5780)
Use the capstone library to disassemble precise-output tests, in addition to pretty-printing their vcode.
This commit is contained in:
@@ -61,7 +61,7 @@ pub fn run(path: &Path, wat: &str) -> Result<()> {
|
||||
.compile(isa)
|
||||
.map_err(|e| crate::pretty_anyhow_error(&e.func, e.inner))?;
|
||||
writeln!(&mut actual, "function {}:", func.name).unwrap();
|
||||
writeln!(&mut actual, "{}", code.disasm.as_ref().unwrap()).unwrap();
|
||||
writeln!(&mut actual, "{}", code.vcode.as_ref().unwrap()).unwrap();
|
||||
} else if config.optimize {
|
||||
let mut ctx = cranelift_codegen::Context::for_function(func.clone());
|
||||
ctx.optimize(isa)
|
||||
|
||||
Reference in New Issue
Block a user