Skip to content

Commit d372643

Browse files
authored
Merge pull request WebAssembly#58 from WebAssembly/rm_let_from_func_bind_test
Remove use of let from func.bind test
2 parents af438f4 + 44a0a77 commit d372643

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

test/core/func_bind.wast

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@
1919
)
2020

2121
(func (export "call2") (param $i i32) (param $j i32) (param $k i32) (result i32)
22-
(call $mk-adder (local.get $k))
23-
(let (result i32) (local $f (ref $unop)) ;; binds $f to top of stack
24-
(i32.mul
25-
(call_ref (local.get $i) (local.get $f))
26-
(call_ref (local.get $j) (local.get $f))
27-
)
22+
(local $f (ref null $unop))
23+
(local.set $f (call $mk-adder (local.get $k)))
24+
25+
(i32.mul
26+
(call_ref (local.get $i) (local.get $f))
27+
(call_ref (local.get $j) (local.get $f))
28+
)
29+
)
30+
31+
(func (export "call3") (param $i i32) (param $j i32) (param $k i32) (result i32)
32+
33+
(i32.mul
34+
(call_ref (local.get $i) (call $mk-adder (local.get $k)))
35+
(call_ref (local.get $j) (call $mk-adder (local.get $k)))
2836
)
2937
)
3038

@@ -50,6 +58,10 @@
5058
(assert_return (invoke "call2" (i32.const 2) (i32.const 5) (i32.const 1)) (i32.const 18))
5159
(assert_return (invoke "call2" (i32.const 2) (i32.const 5) (i32.const 7)) (i32.const 108))
5260

61+
(assert_return (invoke "call3" (i32.const 4) (i32.const 9) (i32.const 1)) (i32.const 50))
62+
(assert_return (invoke "call3" (i32.const 4) (i32.const 7) (i32.const 2)) (i32.const 54))
63+
(assert_return (invoke "call3" (i32.const 4) (i32.const 5) (i32.const 3)) (i32.const 56))
64+
5365
(assert_trap (invoke "null") "null function")
5466

5567
(module

0 commit comments

Comments
 (0)