[MIParser] Set RegClassOrRegBank during instruction parsing
[llvm-complete.git] / test / MC / WebAssembly / annotations.s
blobc663567f4c7f9582478785c58f2afb73259023ab
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.
6 .text
7 .section .text.test_annotation,"",@
8 .type test_annotation,@function
9 test_annotation:
10 .functype test_annotation () -> ()
11 .eventtype __cpp_exception i32
12 try
13 br 0
14 catch
15 block
16 br_if 0
17 loop
18 br_if 1
19 end_loop
20 end_block
21 try
22 rethrow
23 catch
24 block
25 try
26 br 0
27 catch
28 local.set 0
29 block i32
30 local.get 0
31 br_on_exn 0, __cpp_exception
32 rethrow
33 end_block
34 end_try
35 end_block
36 rethrow
37 end_try
38 end_try
39 end_function
42 # CHECK: test_annotation:
43 # CHECK: try
44 # CHECK-NEXT: br 0 # 0: down to label0
45 # CHECK-NEXT: catch # catch0:
46 # CHECK-NEXT: block
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:
52 # CHECK-NEXT: try
53 # CHECK-NEXT: rethrow # down to catch1
54 # CHECK-NEXT: catch # catch1:
55 # CHECK-NEXT: block
56 # CHECK-NEXT: try
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