cranelift: Add wasm tests for duplicate loads (#5514)
* cranelift-filetests: Add the ability to test optimized CLIF in Wasm tests * cranelift: Add Wasm tests for identical loads, back to back
This commit is contained in:
@@ -61,6 +61,11 @@ pub fn run(path: &Path, wat: &str) -> Result<()> {
|
||||
.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();
|
||||
} else if config.optimize {
|
||||
let mut ctx = cranelift_codegen::Context::for_function(func.clone());
|
||||
ctx.optimize(isa)
|
||||
.map_err(|e| crate::pretty_anyhow_error(&ctx.func, e))?;
|
||||
writeln!(&mut actual, "{}", ctx.func.display()).unwrap();
|
||||
} else {
|
||||
writeln!(&mut actual, "{}", func.display()).unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user