1; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 -arm-adjust-jump-tables=0 %s -o - | FileCheck %s 2; RUN: llc -mtriple=thumbv6-eabi -mcpu=cortex-m0 -arm-adjust-jump-tables=0 %s -o - | FileCheck %s 3 4; Do not use tbb / tbh if any destination is before the jumptable. 5; rdar://7102917 6 7define i16 @main__getopt_internal_2E_exit_2E_ce(i32, i1 %b) nounwind { 8; CHECK: main__getopt_internal_2E_exit_2E_ce 9; CHECK-NOT: tbb 10; CHECK-NOT: tbh 11; 32-bit jump tables use explicit branches, not data regions, so make sure 12; we don't annotate this region. 13; CHECK-NOT: data_region 14entry: 15 br i1 %b, label %codeRepl127.exitStub, label %newFuncRoot 16 17codeRepl127.exitStub: ; preds = %_getopt_internal.exit.ce 18 ; Add an explicit edge back to before the jump table to ensure this block 19 ; is placed first. 20 br i1 %b, label %newFuncRoot, label %codeRepl127.exitStub.exit 21 22codeRepl127.exitStub.exit: 23 ret i16 0 24 25parse_options.exit.loopexit.exitStub: ; preds = %_getopt_internal.exit.ce 26 ret i16 1 27 28bb1.i.exitStub: ; preds = %_getopt_internal.exit.ce 29 ret i16 2 30 31bb90.i.exitStub: ; preds = %_getopt_internal.exit.ce 32 ret i16 3 33 34codeRepl104.exitStub: ; preds = %_getopt_internal.exit.ce 35 ret i16 4 36 37codeRepl113.exitStub: ; preds = %_getopt_internal.exit.ce 38 ret i16 5 39 40codeRepl51.exitStub: ; preds = %_getopt_internal.exit.ce 41 ret i16 6 42 43codeRepl70.exitStub: ; preds = %_getopt_internal.exit.ce 44 ret i16 7 45 46codeRepl119.exitStub: ; preds = %_getopt_internal.exit.ce 47 ret i16 8 48 49codeRepl93.exitStub: ; preds = %_getopt_internal.exit.ce 50 ret i16 9 51 52codeRepl101.exitStub: ; preds = %_getopt_internal.exit.ce 53 ret i16 10 54 55codeRepl120.exitStub: ; preds = %_getopt_internal.exit.ce 56 ret i16 11 57 58codeRepl89.exitStub: ; preds = %_getopt_internal.exit.ce 59 ret i16 12 60 61codeRepl45.exitStub: ; preds = %_getopt_internal.exit.ce 62 ret i16 13 63 64codeRepl58.exitStub: ; preds = %_getopt_internal.exit.ce 65 ret i16 14 66 67codeRepl46.exitStub: ; preds = %_getopt_internal.exit.ce 68 ret i16 15 69 70codeRepl50.exitStub: ; preds = %_getopt_internal.exit.ce 71 ret i16 16 72 73codeRepl52.exitStub: ; preds = %_getopt_internal.exit.ce 74 ret i16 17 75 76codeRepl53.exitStub: ; preds = %_getopt_internal.exit.ce 77 ret i16 18 78 79codeRepl61.exitStub: ; preds = %_getopt_internal.exit.ce 80 ret i16 19 81 82codeRepl85.exitStub: ; preds = %_getopt_internal.exit.ce 83 ret i16 20 84 85codeRepl97.exitStub: ; preds = %_getopt_internal.exit.ce 86 ret i16 21 87 88codeRepl79.exitStub: ; preds = %_getopt_internal.exit.ce 89 ret i16 22 90 91codeRepl102.exitStub: ; preds = %_getopt_internal.exit.ce 92 ret i16 23 93 94codeRepl54.exitStub: ; preds = %_getopt_internal.exit.ce 95 ret i16 24 96 97codeRepl57.exitStub: ; preds = %_getopt_internal.exit.ce 98 ret i16 25 99 100codeRepl103.exitStub: ; preds = %_getopt_internal.exit.ce 101 ret i16 26 102 103newFuncRoot: 104 br label %_getopt_internal.exit.ce 105 106_getopt_internal.exit.ce: ; preds = %newFuncRoot 107 switch i32 %0, label %codeRepl127.exitStub [ 108 i32 -1, label %parse_options.exit.loopexit.exitStub 109 i32 0, label %bb1.i.exitStub 110 i32 63, label %bb90.i.exitStub 111 i32 66, label %codeRepl104.exitStub 112 i32 67, label %codeRepl113.exitStub 113 i32 71, label %codeRepl51.exitStub 114 i32 77, label %codeRepl70.exitStub 115 i32 78, label %codeRepl119.exitStub 116 i32 80, label %codeRepl93.exitStub 117 i32 81, label %codeRepl101.exitStub 118 i32 82, label %codeRepl120.exitStub 119 i32 88, label %codeRepl89.exitStub 120 i32 97, label %codeRepl45.exitStub 121 i32 98, label %codeRepl58.exitStub 122 i32 99, label %codeRepl46.exitStub 123 i32 100, label %codeRepl50.exitStub 124 i32 104, label %codeRepl52.exitStub 125 i32 108, label %codeRepl53.exitStub 126 i32 109, label %codeRepl61.exitStub 127 i32 110, label %codeRepl85.exitStub 128 i32 111, label %codeRepl97.exitStub 129 i32 113, label %codeRepl79.exitStub 130 i32 114, label %codeRepl102.exitStub 131 i32 115, label %codeRepl54.exitStub 132 i32 116, label %codeRepl57.exitStub 133 i32 118, label %codeRepl103.exitStub 134 ] 135} 136