1;;! target = "x86_64"
2;;! test = "compile"
3;;! flags = ["-Wexceptions=yes", "-Wgc=yes"]
4
5(module
6 (tag $e0 (param i32 i64))
7
8 (func $throw (param i32 i64)
9       (throw $e0 (local.get 0) (local.get 1)))
10
11 (func $catch (export "catch") (param i32 i64) (result i32 i64)
12
13       (block $b (result i32 i64)
14              (try_table (result i32 i64)
15                         (catch $e0 $b)
16                         (call $throw (local.get 0) (local.get 1))
17                         (i32.const 42)
18                         (i64.const 100)))))
19;; wasm[0]::function[0]::throw:
20;;       pushq   %rbp
21;;       movq    %rsp, %rbp
22;;       movq    8(%rdi), %r10
23;;       movq    0x18(%r10), %r10
24;;       addq    $0x50, %r10
25;;       cmpq    %rsp, %r10
26;;       ja      0x9d
27;;   19: subq    $0x40, %rsp
28;;       movq    %rbx, 0x10(%rsp)
29;;       movq    %r12, 0x18(%rsp)
30;;       movq    %r13, 0x20(%rsp)
31;;       movq    %r14, 0x28(%rsp)
32;;       movq    %r15, 0x30(%rsp)
33;;       movq    %rdi, %rbx
34;;       movq    %rcx, %r12
35;;       movq    %rdx, %r13
36;;       callq   0x385
37;;       movq    %rax, %r14
38;;       movl    $0x4000000, %esi
39;;       movl    $3, %edx
40;;       movl    $0x30, %ecx
41;;       movl    $8, %r8d
42;;       movq    %rbx, %rdi
43;;       callq   0x322
44;;       movq    8(%rbx), %rcx
45;;       movq    0x20(%rcx), %rcx
46;;       movl    %eax, %edx
47;;       movq    %r13, %rsi
48;;       movl    %esi, 0x20(%rcx, %rdx)
49;;       movq    %r12, %rsi
50;;       movq    %rsi, 0x28(%rcx, %rdx)
51;;       movq    %r14, %rsi
52;;       movl    %esi, 0x18(%rcx, %rdx)
53;;       movl    $0, 0x1c(%rcx, %rdx)
54;;       movq    %rax, %rsi
55;;       movq    %rbx, %rdi
56;;       movq    %rbx, (%rsp)
57;;       callq   0x3b2
58;;       ud2
59;;       ud2
60;;
61;; wasm[0]::function[1]::catch:
62;;       pushq   %rbp
63;;       movq    %rsp, %rbp
64;;       movq    8(%rdi), %r10
65;;       movq    0x18(%r10), %r10
66;;       addq    $0x50, %r10
67;;       cmpq    %rsp, %r10
68;;       ja      0x135
69;;   b9: subq    $0x40, %rsp
70;;       movq    %rbx, 0x10(%rsp)
71;;       movq    %r12, 0x18(%rsp)
72;;       movq    %r13, 0x20(%rsp)
73;;       movq    %r14, 0x28(%rsp)
74;;       movq    %r15, 0x30(%rsp)
75;;       movq    %rdi, (%rsp)
76;;       movq    (%rsp), %rsi
77;;       movq    (%rsp), %rdi
78;;       callq   0
79;;       ├─╼ exception frame offset: SP = FP - 0x40
80;;       ╰─╼ exception handler: tag=0, context at [SP+0x0], handler=0xf6
81;;       movl    $0x2a, %eax
82;;       movl    $0x64, %ecx
83;;       jmp     0x113
84;;   f6: movq    %rax, %rdx
85;;       movq    (%rsp), %rsi
86;;       movq    8(%rsi), %rax
87;;       movq    0x20(%rax), %rcx
88;;       movq    %rdx, %rax
89;;       movl    %eax, %edx
90;;       movl    0x20(%rcx, %rdx), %eax
91;;       movq    0x28(%rcx, %rdx), %rcx
92;;       movq    0x10(%rsp), %rbx
93;;       movq    0x18(%rsp), %r12
94;;       movq    0x20(%rsp), %r13
95;;       movq    0x28(%rsp), %r14
96;;       movq    0x30(%rsp), %r15
97;;       addq    $0x40, %rsp
98;;       movq    %rbp, %rsp
99;;       popq    %rbp
100;;       retq
101;;  135: ud2
102