summaryrefslogtreecommitdiff
path: root/test/lit/passes/precompute-ref-func.wast
blob: df4415c7b5a7c4b7cbac4b2edc7675019d92f161 (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
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; RUN: wasm-opt %s -all --precompute -S -o - | filecheck %s

(module
  ;; CHECK:      (type $0 (func (result funcref)))

  ;; CHECK:      (type $shared-func (shared (func (result (ref null (shared func))))))
  (type $shared-func (shared (func (result (ref null (shared func))))))
  ;; CHECK:      (elem declare func $test $test-shared)

  ;; CHECK:      (func $test (type $0) (result funcref)
  ;; CHECK-NEXT:  (return
  ;; CHECK-NEXT:   (ref.func $test)
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT: )
  (func $test (result funcref)
    (block
      (return
        (ref.func $test)
      )
    )
  )

  ;; CHECK:      (func $test-shared (type $shared-func) (result (ref null (shared func)))
  ;; CHECK-NEXT:  (return
  ;; CHECK-NEXT:   (ref.func $test-shared)
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT: )
  (func $test-shared (type $shared-func)
    (block
      (return
        (ref.func $test-shared)
      )
    )
  )
)