summaryrefslogtreecommitdiff
path: root/test/lit/passes/optimize-instructions-exceptions.wast
blob: 9d22224fbb837d0d8bebacad145b2a260d0ca9fb (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
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;; RUN: wasm-opt %s --optimize-instructions --enable-reference-types \
;; RUN:   --enable-exception-handling -S -o - | filecheck %s

(module
  ;; CHECK:      (func $test
  ;; CHECK-NEXT:  (if
  ;; CHECK-NEXT:   (try $try (result i32)
  ;; CHECK-NEXT:    (do
  ;; CHECK-NEXT:     (i32.const 123)
  ;; CHECK-NEXT:    )
  ;; CHECK-NEXT:    (catch_all
  ;; CHECK-NEXT:     (i32.const 456)
  ;; CHECK-NEXT:    )
  ;; CHECK-NEXT:   )
  ;; CHECK-NEXT:   (nop)
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT: )
  (func $test
    (if
      (try (result i32)
        (do
          (i32.eqz
            (i32.eqz
              (i32.const 123)
            )
          )
        )
        (catch_all
          (i32.eqz
            (i32.eqz
              (i32.const 456)
            )
          )
        )
      )
      (nop)
    )
  )
)