1 ; RUN: llc -mtriple=i686-pc-gnu-linux < %s | FileCheck %s -check-prefix=CHECK
2 ; RUN: llc -mtriple=i686-pc-gnu-linux -print-machineinstrs=expand-isel-pseudos %s -o /dev/null 2>&1 | FileCheck %s -check-prefix=CHECK-JT-PROB
5 ; An unreachable default destination is replaced with the most popular case label.
7 define void @foo(i32 %x, i32* %to) {
9 ; CHECK: movl 4(%esp), [[REG:%e[a-z]{2}]]
10 ; CHECK: cmpl $3, [[REG]]
13 ; CHECK-NEXT: jmpl *.LJTI0_0(,[[REG]],4)
18 switch i32 %x, label %default [
46 ; The jump table has four entries.
47 ; CHECK-LABEL: .LJTI0_0:
48 ; CHECK-NEXT: .long .LBB0_2
49 ; CHECK-NEXT: .long .LBB0_3
50 ; CHECK-NEXT: .long .LBB0_4
51 ; CHECK-NEXT: .long .LBB0_5
54 ; Check if branch probabilities are correctly assigned to the jump table.
56 define void @bar(i32 %x, i32* %to) {
57 ; CHECK-JT-PROB-LABEL: bar:
58 ; CHECK-JT-PROB: Successors according to CFG: BB#6({{[0-9a-fx/= ]+}}14.29%) BB#8({{[0-9a-fx/= ]+}}85.71%)
59 ; CHECK-JT-PROB: Successors according to CFG: BB#1({{[0-9a-fx/= ]+}}16.67%) BB#2({{[0-9a-fx/= ]+}}16.67%) BB#3({{[0-9a-fx/= ]+}}16.67%) BB#4({{[0-9a-fx/= ]+}}16.67%) BB#5({{[0-9a-fx/= ]+}}33.33%)
62 switch i32 %x, label %default [
92 !1 = !{!"branch_weights", i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16}