summaryrefslogtreecommitdiff
path: root/test/lit/select-gc.wat
blob: bd1394950f62c9ab9e3b3d313bb7dcf1a3e208c4 (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
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.

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

;; Check that annotated select is propery roundtripped, even if the type is
;; only used in that one place in the whole module.

(module
  ;; CHECK:      (type $struct (struct))
  (type $struct (struct))

  ;; CHECK:      (func $foo (type $0) (result anyref)
  ;; CHECK-NEXT:  (select (result (ref null $struct))
  ;; CHECK-NEXT:   (ref.null none)
  ;; CHECK-NEXT:   (ref.null none)
  ;; CHECK-NEXT:   (i32.const 1)
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT: )
  (func $foo (result anyref)
    (select (result (ref null $struct))
      (ref.null any)
      (ref.null eq)
      (i32.const 1)
    )
  )
)