xref: /llvm-project-15.0.7/llvm/test/MC/WebAssembly/annotations.s (revision 9e4eadeb)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+exception-handling < %s | FileCheck %s
2
3# Tests if block/loop/try/catch/end/branch/rethrow instructions are correctly
4# printed with their annotations.
5
6  .text
7  .section .text.test_annotation,"",@
8  .type    test_annotation,@function
9test_annotation:
10  .functype   test_annotation () -> ()
11  .eventtype  __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  block
25  try
26  br        0
27  catch     __cpp_exception
28  local.set 0
29  end_try
30  end_block
31  rethrow   0
32  end_try
33  end_try
34  end_function
35
36
37# CHECK:      test_annotation:
38# CHECK:        try
39# CHECK-NEXT:   br        0               # 0: down to label0
40# CHECK-NEXT:   catch     __cpp_exception # catch0:
41# CHECK-NEXT:   block
42# CHECK-NEXT:   br_if     0               # 0: down to label1
43# CHECK-NEXT:   loop                      # label2:
44# CHECK-NEXT:   br_if     1               # 1: down to label1
45# CHECK-NEXT:   end_loop
46# CHECK-NEXT:   end_block                 # label1:
47# CHECK-NEXT:   try
48# CHECK-NEXT:   rethrow   0               # down to catch1
49# CHECK-NEXT:   catch     __cpp_exception # catch1:
50# CHECK-NEXT:   block
51# CHECK-NEXT:   try
52# CHECK-NEXT:   br        0               # 0: down to label5
53# CHECK-NEXT:   catch     __cpp_exception # catch2:
54# CHECK-NEXT:   local.set 0
55# CHECK-NEXT:   end_try                   # label5:
56# CHECK-NEXT:   end_block                 # label4:
57# CHECK-NEXT:   rethrow   0               # to caller
58# CHECK-NEXT:   end_try                   # label3:
59# CHECK-NEXT:   end_try                   # label0:
60# CHECK-NEXT:   end_function
61
62

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026