summaryrefslogtreecommitdiff
path: root/test/lit/select-gc.wat
blob: 8cc1d4ca74f162da914f0e03a328ea3806224a47 (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 $none_=>_anyref) (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)
    )
  )
)