summaryrefslogtreecommitdiff
path: root/test/lit/exec/eh.wast
blob: 45215b048681f2e32adc9b46e7e3430071346394 (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
;; NOTE: Assertions have been generated by update_lit_checks.py --output=fuzz-exec and should not be edited.

;; RUN: wasm-opt %s -all --fuzz-exec -q -o /dev/null 2>&1 | filecheck %s

(module
  (tag $e-i32 (param i32))

  ;; CHECK:      [fuzz-exec] calling throw
  ;; CHECK-NEXT: [exception thrown: e-i32 1]
  (func $throw (export "throw")
    (throw $e-i32 (i32.const 1))
  )

  ;; CHECK:      [fuzz-exec] calling try_table-catch
  (func $try_table-catch (export "try_table-catch")
    (block $tryend
      (drop
        (block $catch (result i32)
          (try_table (catch $e-i32 $catch)
            (throw $e-i32 (i32.const 2))
          )
          (br $tryend)
        )
      )
    )
  )

  ;; CHECK:      [fuzz-exec] calling catchless-try_table
  ;; CHECK-NEXT: [exception thrown: e-i32 3]
  (func $catchless-try_table (export "catchless-try_table")
    (try_table
      (throw $e-i32 (i32.const 3))
    )
  )
)
;; CHECK:      [fuzz-exec] calling throw
;; CHECK-NEXT: [exception thrown: e-i32 1]

;; CHECK:      [fuzz-exec] calling try_table-catch

;; CHECK:      [fuzz-exec] calling catchless-try_table
;; CHECK-NEXT: [exception thrown: e-i32 3]
;; CHECK-NEXT: [fuzz-exec] comparing catchless-try_table
;; CHECK-NEXT: [fuzz-exec] comparing throw
;; CHECK-NEXT: [fuzz-exec] comparing try_table-catch