This commit is contained in:
Graham Kelly 2024-01-20 11:37:12 -05:00
parent bd6ae8eb8d
commit 411267673d
2 changed files with 10 additions and 0 deletions

3
test.sh Normal file
View file

@ -0,0 +1,3 @@
wat2wasm --enable-tail-call $1 -o $1.wasm
cargo run roundtrip -i $1.wasm -o $1.rt.wasm
wasm2wat --enable-tail-call $1.rt.wasm

7
wasm_tests/test4.wat Normal file
View file

@ -0,0 +1,7 @@
(module
(func $a (param i32) (param i32) (result i32)
(local $diff i32)
(local.set $diff (i32.const 1))
(if (i32.eqz (local.get 0)) (return (local.get 1)))
(return_call $a (i32.sub (local.get 0) (local.get $diff)) (i32.add (local.get 1) (local.get $diff)))
))