1 ; RUN: llc -O2 -mtriple=thumbv7m-eabi < %s | FileCheck %s
2 ; RUN: llc -O2 -mtriple=thumbv8m.main-eabi < %s | FileCheck %s
4 define dso_local i32 @test_for_tbb_tbh_cases(i32 noundef %x) local_unnamed_addr #0 {
6 switch i32 %x, label %sw.default [
13 sw.bb: ; preds = %entry
14 %call = tail call i32 @g(i32 noundef 0) #2
15 %add = add nsw i32 %call, 1
18 sw.bb2: ; preds = %entry
21 sw.bb3: ; preds = %entry
24 sw.default: ; preds = %entry
27 return: ; preds = %entry, %sw.default, %sw.bb3, %sw.bb2, %sw.bb
28 %retval.0 = phi i32 [ 5, %sw.default ], [ 4, %sw.bb3 ], [ 3, %sw.bb2 ], [ %add, %sw.bb ], [ 2, %entry ]
32 ; CHECK-LABEL: .LBB0_3:
34 ; CHECK-LABEL: .LBB0_4:
36 ; CHECK-LABEL: .LBB0_5:
38 ; CHECK-LABEL: .LBB0_6:
40 ; CHECK-LABEL: .LBB0_7:
44 declare dso_local i32 @g(i32 noundef) local_unnamed_addr #1
46 define dso_local i32 @test_for_direct_jump_cases(i32 noundef %x) local_unnamed_addr #0 {
48 switch i32 %x, label %sw.default [
55 sw.bb: ; preds = %entry
56 tail call void asm sideeffect ".space 140000", ""()
59 sw.bb2: ; preds = %entry
62 sw.bb3: ; preds = %entry
65 sw.default: ; preds = %entry
68 cleanup: ; preds = %entry, %sw.default, %sw.bb3, %sw.bb2, %sw.bb
69 %retval.0 = phi i32 [ 5, %sw.default ], [ 4, %sw.bb3 ], [ 3, %sw.bb2 ], [ 1, %sw.bb ], [ %x, %entry ]
73 ; CHECK-LABEL: .LBB1_3:
75 ; CHECK-LABEL: .LBB1_4:
77 ; CHECK-LABEL: .LBB1_5:
79 ; CHECK-LABEL: .LBB1_6:
81 ; CHECK-LABEL: .LBB1_7: