fix(tests): Use updated keywords

This commit is contained in:
Edoardo Marangoni
2024-09-06 16:43:56 +02:00
parent 38951eb765
commit 51a070e920
4 changed files with 13 additions and 13 deletions

View File

@ -16,7 +16,7 @@ macro_rules! mvr_test {
&stringify!( $( $result_type ),* ).replace(",", "").replace("(", "").replace(")", "") + &r#")))
(import "host" "callback_fn" (func $callback_fn (type $type)))
(func (export "test_call") (type $type)
get_local 0
local.get 0
call $callback_fn)
(func (export "test_call_indirect") (type $type)
(i32.const 1)

View File

@ -9,15 +9,15 @@
(export "main" (func $main))
(func $dispatch (; 0 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call_indirect (type $multiply_signature)
(get_local $1)
(get_local $2)
(get_local $0)
(local.get $1)
(local.get $2)
(local.get $0)
)
)
(func $multiply (; 1 ;) (type $multiply_signature) (param $0 i32) (param $1 i32) (result i32)
(i32.mul
(get_local $1)
(get_local $0)
(local.get $1)
(local.get $0)
)
)
(func $main (; 2 ;) (result i32)

View File

@ -4,15 +4,15 @@
)
(func $fib (param $n i32) (result i32)
(if (i32.eq (get_local $n) (i32.const 0))
(if (i32.eq (local.get $n) (i32.const 0))
(then (return (i32.const 1)))
)
(if (i32.eq (get_local $n) (i32.const 1))
(if (i32.eq (local.get $n) (i32.const 1))
(then (return (i32.const 1)))
)
(i32.add
(call $fib (i32.sub (get_local $n) (i32.const 1)))
(call $fib (i32.sub (get_local $n) (i32.const 2)))
(call $fib (i32.sub (local.get $n) (i32.const 1)))
(call $fib (i32.sub (local.get $n) (i32.const 2)))
)
)

View File

@ -3,13 +3,13 @@
(table 20 anyfunc)
(elem (i32.const 9) $f)
(func $f (param i32) (result i32)
(get_local 0)
(local.get 0)
)
(func $main (export "main") (result i32)
(local i32)
(set_local 0 (i32.const 100))
(i32.store (get_local 0) (i32.const 1602))
(i32.load (get_local 0))
(i32.store (local.get 0) (i32.const 1602))
(i32.load (local.get 0))
(drop)
(memory.grow (i32.const 0))