Skip to content

Commit

Permalink
Add test for debug-crash.
Browse files Browse the repository at this point in the history
This also was a wrong-code bug (I think), but we can't yet write tests for those.
  • Loading branch information
nlewycky committed Dec 2, 2019
1 parent ad752d6 commit 7c6d73d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/llvm-backend-tests/tests/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit 7c6d73d

Please sign in to comment.