Add test for debug-crash.

This also was a wrong-code bug (I think), but we can't yet write tests for those.
This commit is contained in:
Nick Lewycky
2019-12-02 15:49:33 -08:00
parent ad752d66a7
commit 7c6d73d4d9

View File

@ -18,5 +18,23 @@ fn crash_return_with_float_on_stack() {
"#;
let wasm_binary = wat2wasm(MODULE.as_bytes()).expect("WAST not valid or malformed");
let module = compile_with(&wasm_binary, &get_compiler()).unwrap();
let instance = module.instantiate(&imports! {}).unwrap();
module.instantiate(&imports! {}).unwrap();
}
#[test]
fn crash_select_with_mismatched_pending() {
const MODULE: &str = r#"
(module
(func (param f64)
f64.const 0x0p+0 (;=0;)
local.get 0
f64.add
f64.const 0x0p+0 (;=0;)
i32.const 0
select
drop))
"#;
let wasm_binary = wat2wasm(MODULE.as_bytes()).expect("WAST not valid or malformed");
let module = compile_with(&wasm_binary, &get_compiler()).unwrap();
module.instantiate(&imports! {}).unwrap();
}