[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / llvm / test / MC / WebAssembly / annotations.s
blobf761ef3f06b1fc1445059417aa06734525c9911a
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 (exnref) -> ()
11 .tagtype __cpp_exception i32
12 .tagtype __c_longjmp i32
13 try
14 br 0
15 catch __cpp_exception
16 drop
17 block
18 i32.const 0
19 br_if 0
20 loop
21 i32.const 0
22 br_if 1
23 end_loop
24 end_block
25 try
26 rethrow 0
27 catch __cpp_exception
28 drop
29 catch_all
30 block
31 try
32 br 0
33 try
34 delegate 1
35 catch_all
36 end_try
37 end_block
38 rethrow 0
39 end_try
40 end_try
42 block exnref
43 block
44 block () -> (i32, exnref)
45 block i32
46 try_table (catch __cpp_exception 0) (catch_ref __c_longjmp 1) (catch_all 2) (catch_all_ref 3)
47 end_try_table
48 return
49 end_block
50 return
51 end_block
52 return
53 end_block
54 return
55 end_block
56 drop
58 i32.const 0
59 loop (i32) -> ()
60 local.get 0
61 loop (exnref) -> ()
62 try_table (catch __cpp_exception 1) (catch_all_ref 0)
63 end_try_table
64 drop
65 end_loop
66 drop
67 end_loop
68 end_function
70 # CHECK: test_annotation:
71 # CHECK: try
72 # CHECK-NEXT: br 0 # 0: down to label0
73 # CHECK-NEXT: catch __cpp_exception # catch0:
74 # CHECK-NEXT: drop
75 # CHECK-NEXT: block
76 # CHECK-NEXT: i32.const 0
77 # CHECK-NEXT: br_if 0 # 0: down to label1
78 # CHECK-NEXT: loop # label2:
79 # CHECK-NEXT: i32.const 0
80 # CHECK-NEXT: br_if 1 # 1: down to label1
81 # CHECK-NEXT: end_loop
82 # CHECK-NEXT: end_block # label1:
83 # CHECK-NEXT: try
84 # CHECK-NEXT: rethrow 0 # down to catch3
85 # CHECK-NEXT: catch __cpp_exception # catch3:
86 # CHECK-NEXT: drop
87 # CHECK-NEXT: catch_all{{$}}
88 # CHECK-NEXT: block
89 # CHECK-NEXT: try
90 # CHECK-NEXT: br 0 # 0: down to label5
91 # CHECK-NEXT: try
92 # CHECK-NEXT: delegate 1 # label/catch6: down to catch4
93 # CHECK-NEXT: catch_all # catch5:
94 # CHECK-NEXT: end_try # label5:
95 # CHECK-NEXT: end_block # label4:
96 # CHECK-NEXT: rethrow 0 # to caller
97 # CHECK-NEXT: end_try # label3:
98 # CHECK-NEXT: end_try # label0:
100 # CHECK: block exnref
101 # CHECK-NEXT: block
102 # CHECK-NEXT: block () -> (i32, exnref)
103 # CHECK-NEXT: block i32
104 # CHECK-NEXT: try_table (catch __cpp_exception 0) (catch_ref __c_longjmp 1) (catch_all 2) (catch_all_ref 3) # 0: down to label10
105 # CHECK-NEXT: # 1: down to label9
106 # CHECK-NEXT: # 2: down to label8
107 # CHECK-NEXT: # 3: down to label7
108 # CHECK-NEXT: end_try_table # label11:
109 # CHECK-NEXT: return
110 # CHECK-NEXT: end_block # label10:
111 # CHECK-NEXT: return
112 # CHECK-NEXT: end_block # label9:
113 # CHECK-NEXT: return
114 # CHECK-NEXT: end_block # label8:
115 # CHECK-NEXT: return
116 # CHECK-NEXT: end_block # label7:
117 # CHECK-NEXT: drop
119 # CHECK: i32.const 0
120 # CHECK-NEXT: loop (i32) -> () # label12:
121 # CHECK-NEXT: local.get 0
122 # CHECK-NEXT: loop (exnref) -> () # label13:
123 # CHECK-NEXT: try_table (catch __cpp_exception 1) (catch_all_ref 0) # 1: up to label12
124 # CHECK-NEXT: # 0: up to label13
125 # CHECK-NEXT: end_try_table # label14:
126 # CHECK-NEXT: drop
127 # CHECK-NEXT: end_loop
128 # CHECK-NEXT: drop
129 # CHECK-NEXT: end_loop
130 # CHECK-NEXT: end_function