summaryrefslogtreecommitdiff
path: root/test/spec/multivalue.wast
blob: bd8d2579155da27b0fd77bf631755adbf756e735 (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
(module
 (global $global_pair (mut (tuple i32 i64)) (tuple.make 2 (i32.const 0) (i64.const 0)))
 (func $pair (export "pair") (result i32 i64)
  (tuple.make 2
   (i32.const 42)
   (i64.const 7)
  )
 )
 (func (export "tuple-local") (result i32 i64)
  (local $x (tuple i32 i64))
  (local.get $x)
 )
 (func (export "tuple-global-get") (result i32 i64)
  (global.get $global_pair)
 )
 (func (export "tuple-global-set")
  (global.set $global_pair
   (tuple.make 2
    (i32.const 42)
    (i64.const 7)
   )
  )
 )
 (func (export "tail-call") (result i32 i64)
  (return_call $pair)
  (unreachable)
 )
)

;; (assert_return (invoke "pair") (tuple.make 2 (i32.const 42) (i64.const 7)))
;; (assert_return (invoke "tuple-local") (tuple.make 2 (i32.const 0) (i64.const 0)))
;; (assert_return (invoke "tuple-global-get") (tuple.make 2 (i32.const 0) (i64.const 0)))
;; (assert_return (invoke "tuple-global-set"))
;; (assert_return (invoke "tuple-global-get") (tuple.make 2 (i32.const 42) (i64.const 7)))
;; (assert_return (invoke "tail-call") (tuple.make 2 (i32.const 42) (i64.const 7)))