xref: /llvm-project/llvm/test/CodeGen/WebAssembly/stack-insts.ll (revision 122b0220fd45ee71acda912b0b712bb8edb6ba46)
1; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs | FileCheck %s
2
3target triple = "wasm32-unknown-unknown"
4
5declare void @foo0()
6declare void @foo1()
7
8; Tests if br_table is printed correctly with a tab.
9; CHECK-LABEL: test0:
10; CHECK: br_table {0, 1, 0, 1, 2}
11define void @test0(i32 %n) {
12entry:
13  switch i32 %n, label %sw.epilog [
14    i32 0, label %sw.bb
15    i32 1, label %sw.bb.1
16    i32 2, label %sw.bb
17    i32 3, label %sw.bb.1
18  ]
19
20sw.bb:                                            ; preds = %entry, %entry
21  tail call void @foo0()
22  br label %sw.epilog
23
24sw.bb.1:                                          ; preds = %entry, %entry
25  tail call void @foo1()
26  br label %sw.epilog
27
28sw.epilog:                                        ; preds = %entry, %sw.bb, %sw.bb.1
29  ret void
30}
31