1 # RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+exception-handling < %s | FileCheck %s
3 # Tests if block/loop/try/catch/end/branch/rethrow instructions are correctly
4 # printed with their annotations.
7 .section .text.test_annotation,"",@
8 .type test_annotation,@function
10 .functype test_annotation () -> ()
11 .eventtype __cpp_exception i32
31 br_on_exn
0, __cpp_exception
42 # CHECK: test_annotation:
44 # CHECK-NEXT: br 0 # 0: down to label0
45 # CHECK-NEXT: catch # catch0:
47 # CHECK-NEXT: br_if 0 # 0: down to label1
48 # CHECK-NEXT: loop # label2:
49 # CHECK-NEXT: br_if 1 # 1: down to label1
50 # CHECK-NEXT: end_loop
51 # CHECK-NEXT: end_block # label1:
53 # CHECK-NEXT: rethrow # down to catch1
54 # CHECK-NEXT: catch # catch1:
57 # CHECK-NEXT: br 0 # 0: down to label5
58 # CHECK-NEXT: catch # catch2:
59 # CHECK-NEXT: local.set 0
60 # CHECK-NEXT: block i32
61 # CHECK-NEXT: local.get 0
62 # CHECK-NEXT: br_on_exn 0, __cpp_exception # 0: down to label6
63 # CHECK-NEXT: rethrow # to caller
64 # CHECK-NEXT: end_block # label6:
65 # CHECK-NEXT: end_try # label5:
66 # CHECK-NEXT: end_block # label4:
67 # CHECK-NEXT: rethrow # to caller
68 # CHECK-NEXT: end_try # label3:
69 # CHECK-NEXT: end_try # label0:
70 # CHECK-NEXT: end_function