mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-05 02:20:19 +00:00
Validate return values in indirect call test.
This commit is contained in:
parent
683cb2090c
commit
c3b0bd76a1
@ -1,12 +1,25 @@
|
||||
(module
|
||||
(type $binop (func (param i32 i32) (result i32)))
|
||||
(table 1 100 anyfunc)
|
||||
(elem (i32.const 5) $sub)
|
||||
(elem (i32.const 10) $add)
|
||||
|
||||
(func $main (export "main") (result i32)
|
||||
(call_indirect (type $binop) (i32.const 42) (i32.const 1) (i32.const 10))
|
||||
(func $main (export "main")
|
||||
(if (i32.eq (call_indirect (type $binop) (i32.const 42) (i32.const 1) (i32.const 10)) (i32.const 43))
|
||||
(then)
|
||||
(else unreachable)
|
||||
)
|
||||
(if (i32.eq (call_indirect (type $binop) (i32.const 42) (i32.const 1) (i32.const 5)) (i32.const 41))
|
||||
(then)
|
||||
(else unreachable)
|
||||
)
|
||||
)
|
||||
|
||||
(func $add (param i32) (param i32) (result i32)
|
||||
(i32.add (get_local 0) (get_local 1))
|
||||
)
|
||||
|
||||
(func $sub (param i32) (param i32) (result i32)
|
||||
(i32.sub (get_local 0) (get_local 1))
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user