summaryrefslogtreecommitdiff
path: root/test/lit/basic/shared-i31.wast
blob: b448bcad3262ceda66410d1e6822877dbf007e48 (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
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.

;; RUN: wasm-opt %s -all -S -o - | filecheck %s
;; RUN: wasm-opt %s -all --roundtrip -S -o - | filecheck %s

(module
  ;; CHECK:      (type $0 (func (param (ref null (shared i31))) (result i32)))

  ;; CHECK:      (type $1 (func (param i32) (result (ref (shared i31)))))

  ;; CHECK:      (func $make (type $1) (param $0 i32) (result (ref (shared i31)))
  ;; CHECK-NEXT:  (ref.i31_shared
  ;; CHECK-NEXT:   (local.get $0)
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT: )
  (func $make (param i32) (result (ref (shared i31)))
    (ref.i31_shared (local.get 0))
  )

  ;; CHECK:      (func $get_s (type $0) (param $0 (ref null (shared i31))) (result i32)
  ;; CHECK-NEXT:  (i31.get_s
  ;; CHECK-NEXT:   (local.get $0)
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT: )
  (func $get_s (param (ref null (shared i31))) (result i32)
    (i31.get_s (local.get 0))
  )

  ;; CHECK:      (func $get_u (type $0) (param $0 (ref null (shared i31))) (result i32)
  ;; CHECK-NEXT:  (i31.get_u
  ;; CHECK-NEXT:   (local.get $0)
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT: )
  (func $get_u (param (ref null (shared i31))) (result i32)
    (i31.get_u (local.get 0))
  )
)