summaryrefslogtreecommitdiff
path: root/test/interp/call-multi-result.txt
blob: 584bd9ded396392facfd93d753f0c6951172def8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
;;; TOOL: run-interp
(module
  (func $i32_i64 (result i32 i64)
    i32.const 1
    i64.const 2)

  (func (export "call-multi-result") (result i32)
    call $i32_i64
    i32.wrap_i64
    i32.add)

  (func $rot_f32_3 (param f32 f32 f32) (result f32 f32 f32)
    local.get 1
    local.get 2
    local.get 0)

  (func (export "call-multi-param-result") (result i32)
    block $fail
      f32.const 11
      f32.const 22
      f32.const 33

      ;; updates stack: 11 22 33 -- 22 33 11
      call $rot_f32_3

      f32.const 11
      f32.ne
      br_if $fail

      f32.const 33
      f32.ne
      br_if $fail

      f32.const 22
      f32.ne
      br_if $fail

      i32.const 1
      return
    end

    i32.const 0)
)
(;; STDOUT ;;;
call-multi-result() => i32:3
call-multi-param-result() => i32:1
;;; STDOUT ;;)