1 ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs | FileCheck %s
3 target triple = "wasm32-unknown-unknown"
5 ; Test that switches are lowered correctly in the presence of an
6 ; unreachable default branch target.
9 ; CHECK-NEXT: .functype foo (i32) -> (i32)
12 ; CHECK-NEXT: local.get 0
13 ; CHECK-NEXT: br_table {0, 1, 0}
14 ; CHECK-NEXT: .LBB0_1:
15 ; CHECK-NEXT: end_block
16 ; CHECK-NEXT: i32.const 0
18 ; CHECK-NEXT: .LBB0_2:
19 ; CHECK-NEXT: end_block
20 ; CHECK-NEXT: i32.const 1
21 ; CHECK-NEXT: end_function
22 define i32 @foo(i32 %x) {
24 switch i32 %x, label %unreachable [
40 ; CHECK: .functype split (i32) -> ()
45 ; CHECK: br_table {1, 1, 0}
48 ; CHECK: br_table {0, 0, 0, 0, 0, 0, 0, 0}
55 define void @split(i8 %c) {
57 switch i8 %c, label %sw.default [