Fix br_if and br_table

This commit is contained in:
Jef
2019-03-07 13:21:04 +01:00
parent a4e878da75
commit 45ccc591cd
10 changed files with 619 additions and 313 deletions

View File

@@ -1181,6 +1181,21 @@ fn fib_opt() {
}
}
#[test]
fn i32_div() {
const CODE: &str = r"
(module
(func (param i32) (param i32) (result i32)
(i32.div_s (get_local 0) (get_local 1))
)
)";
let translated = translate_wat(CODE);
translated.disassemble();
assert_eq!(translated.execute_func::<_, u32>(0, (1, 1)), Ok(1));
}
#[test]
fn br_table() {
const CODE: &str = r"
@@ -1940,4 +1955,3 @@ fn sieve() {
translate(&wabt::wat2wasm(CODE).unwrap()).unwrap();
}