Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / WebAssembly / annotations.s
blob18fd16f2dc687b65ea61f416f633a6fa48cbd2e2
1 # RUN: llvm-mc -no-type-check -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 .tagtype __cpp_exception i32
12 try
13 br 0
14 catch __cpp_exception
15 block
16 br_if 0
17 loop
18 br_if 1
19 end_loop
20 end_block
21 try
22 rethrow 0
23 catch __cpp_exception
24 catch_all
25 block
26 try
27 br 0
28 try
29 delegate 1
30 catch_all
31 end_try
32 end_block
33 rethrow 0
34 end_try
35 end_try
36 end_function
39 # CHECK: test_annotation:
40 # CHECK: try
41 # CHECK-NEXT: br 0 # 0: down to label0
42 # CHECK-NEXT: catch __cpp_exception # catch0:
43 # CHECK-NEXT: block
44 # CHECK-NEXT: br_if 0 # 0: down to label1
45 # CHECK-NEXT: loop # label2:
46 # CHECK-NEXT: br_if 1 # 1: down to label1
47 # CHECK-NEXT: end_loop
48 # CHECK-NEXT: end_block # label1:
49 # CHECK-NEXT: try
50 # CHECK-NEXT: rethrow 0 # down to catch3
51 # CHECK-NEXT: catch __cpp_exception # catch3:
52 # CHECK-NEXT: catch_all{{$}}
53 # CHECK-NEXT: block
54 # CHECK-NEXT: try
55 # CHECK-NEXT: br 0 # 0: down to label5
56 # CHECK-NEXT: try
57 # CHECK-NEXT: delegate 1 # label/catch6: down to catch4
58 # CHECK-NEXT: catch_all # catch5:
59 # CHECK-NEXT: end_try # label5:
60 # CHECK-NEXT: end_block # label4:
61 # CHECK-NEXT: rethrow 0 # to caller
62 # CHECK-NEXT: end_try # label3:
63 # CHECK-NEXT: end_try # label0:
64 # CHECK-NEXT: end_function