summaryrefslogtreecommitdiff
path: root/test/interp/rethrow.txt
blob: 67bd3abbca908e1bf99f88e085cc7e4f0328f479 (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
;;; TOOL: run-interp
;;; ARGS*: --enable-exceptions
(module
  (tag $e1)
  (tag $e2)
  (func (export "rethrow-uncaught")
    (try
      (do
        (throw $e1))
      (catch $e1
        (rethrow 0))))
  (func (export "rethrow-1") (result i32)
    (try (result i32)
      (do
        (try
          (do
            (throw $e1))
          (catch $e1
            (rethrow 0)))
        (i32.const 0))
      (catch_all
        (i32.const 1))))
  (func (export "rethrow-2") (result i32)
    (try (result i32)
      (do
        (try
          (do
            (throw $e1))
          (catch $e1
            (try
              (do
                (throw $e2))
              (catch $e2
                (rethrow 1)))))
        (i32.const 0))
      (catch $e1
        (i32.const 1))))
  )
(;; STDOUT ;;;
rethrow-uncaught() => error: uncaught exception
rethrow-1() => i32:1
rethrow-2() => i32:1
;;; STDOUT ;;)