mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-22 16:35:33 +00:00
fix(tests): Use updated keywords
This commit is contained in:
@ -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)
|
||||
|
10
tests/examples/call_indirect.wat
vendored
10
tests/examples/call_indirect.wat
vendored
@ -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)
|
||||
|
8
tests/examples/fib.wat
vendored
8
tests/examples/fib.wat
vendored
@ -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)))
|
||||
)
|
||||
)
|
||||
|
||||
|
6
tests/examples/memory.wat
vendored
6
tests/examples/memory.wat
vendored
@ -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))
|
||||
|
Reference in New Issue
Block a user