summaryrefslogtreecommitdiff
path: root/test/lit/passes/stack-ir-eh.wast
blob: e06e5e5172d108dd7782dc6ae28844276dfa3f97 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;; RUN: wasm-opt %s --generate-stack-ir --optimize-stack-ir \
;; RUN:   -all --print-stack-ir | filecheck %s

(module
  ;; CHECK:      (tag $e-i32 (param i32))
  (tag $e-i32 (param i32))

  ;; CHECK:      (func $foo (type $0)
  ;; CHECK-NEXT: )
  (func $foo)

  ;; CHECK:      (func $test (type $0)
  ;; CHECK-NEXT:  block $outer
  ;; CHECK-NEXT:   block $l-catch (result i32)
  ;; CHECK-NEXT:    block $l-catch-ref (type $1) (result i32 exnref)
  ;; CHECK-NEXT:     block $l-catch-all
  ;; CHECK-NEXT:      block $l-catch-all-ref (result exnref)
  ;; CHECK-NEXT:       try_table (catch $e-i32 $l-catch) (catch_ref $e-i32 $l-catch-ref) (catch_all $l-catch-all) (catch_all_ref $l-catch-all-ref)
  ;; CHECK-NEXT:        call $foo
  ;; CHECK-NEXT:       end
  ;; CHECK-NEXT:       br $outer
  ;; CHECK-NEXT:      end
  ;; CHECK-NEXT:      throw_ref
  ;; CHECK-NEXT:     end
  ;; CHECK-NEXT:     br $outer
  ;; CHECK-NEXT:    end
  ;; CHECK-NEXT:    tuple.drop 2
  ;; CHECK-NEXT:    br $outer
  ;; CHECK-NEXT:   end
  ;; CHECK-NEXT:   drop
  ;; CHECK-NEXT:  end
  ;; CHECK-NEXT: )
  (func $test
    (block $outer
      (drop
        (block $l-catch (result i32)
          (tuple.drop 2
            (block $l-catch-ref (result i32 exnref)
              (block $l-catch-all
                (throw_ref
                  (block $l-catch-all-ref (result exnref)
                    (try_table (catch $e-i32 $l-catch)
                               (catch_ref $e-i32 $l-catch-ref)
                               (catch_all $l-catch-all)
                               (catch_all_ref $l-catch-all-ref)
                      (call $foo)
                    )
                    (br $outer)
                  )
                )
              )
              (br $outer)
            )
          )
          (br $outer)
        )
      )
    )
  )
)