1 ; RUN: llc -mtriple=x86_64-unknown-linux < %s | FileCheck %s
3 @g = external global i8
16 declare void @llvm.icall.branch.funnel(...)
18 define void @jt2(i8* nest, ...) {
20 ; CHECK: leaq g+1(%rip), %r11
21 ; CHECK-NEXT: cmpq %r11, %r10
22 ; CHECK-NEXT: jae .LBB0_1
25 ; CHECK-NEXT: .LBB0_1:
27 musttail call void (...) @llvm.icall.branch.funnel(
29 i8* getelementptr (i8, i8* @g, i64 0), void ()* @f0,
30 i8* getelementptr (i8, i8* @g, i64 1), void ()* @f1,
36 define void @jt3(i8* nest, ...) {
38 ; CHECK: leaq g+1(%rip), %r11
39 ; CHECK-NEXT: cmpq %r11, %r10
40 ; CHECK-NEXT: jae .LBB1_1
43 ; CHECK-NEXT: .LBB1_1:
44 ; CHECK-NEXT: jne .LBB1_2
47 ; CHECK-NEXT: .LBB1_2:
49 musttail call void (...) @llvm.icall.branch.funnel(
51 i8* getelementptr (i8, i8* @g, i64 0), void ()* @f0,
52 i8* getelementptr (i8, i8* @g, i64 2), void ()* @f2,
53 i8* getelementptr (i8, i8* @g, i64 1), void ()* @f1,
59 define void @jt7(i8* nest, ...) {
61 ; CHECK: leaq g+3(%rip), %r11
62 ; CHECK-NEXT: cmpq %r11, %r10
63 ; CHECK-NEXT: jae .LBB2_1
65 ; CHECK-NEXT: leaq g+1(%rip), %r11
66 ; CHECK-NEXT: cmpq %r11, %r10
67 ; CHECK-NEXT: jae .LBB2_6
70 ; CHECK-NEXT: .LBB2_1:
71 ; CHECK-NEXT: jne .LBB2_2
74 ; CHECK-NEXT: .LBB2_6:
75 ; CHECK-NEXT: jne .LBB2_7
78 ; CHECK-NEXT: .LBB2_2:
79 ; CHECK-NEXT: leaq g+5(%rip), %r11
80 ; CHECK-NEXT: cmpq %r11, %r10
81 ; CHECK-NEXT: jae .LBB2_3
84 ; CHECK-NEXT: .LBB2_7:
86 ; CHECK-NEXT: .LBB2_3:
87 ; CHECK-NEXT: jne .LBB2_4
90 ; CHECK-NEXT: .LBB2_4:
92 musttail call void (...) @llvm.icall.branch.funnel(
94 i8* getelementptr (i8, i8* @g, i64 0), void ()* @f0,
95 i8* getelementptr (i8, i8* @g, i64 1), void ()* @f1,
96 i8* getelementptr (i8, i8* @g, i64 2), void ()* @f2,
97 i8* getelementptr (i8, i8* @g, i64 3), void ()* @f3,
98 i8* getelementptr (i8, i8* @g, i64 4), void ()* @f4,
99 i8* getelementptr (i8, i8* @g, i64 5), void ()* @f5,
100 i8* getelementptr (i8, i8* @g, i64 6), void ()* @f6,
106 define void @jt10(i8* nest, ...) {
108 ; CHECK: leaq g+5(%rip), %r11
109 ; CHECK-NEXT: cmpq %r11, %r10
110 ; CHECK-NEXT: jae .LBB3_1
112 ; CHECK-NEXT: leaq g+1(%rip), %r11
113 ; CHECK-NEXT: cmpq %r11, %r10
114 ; CHECK-NEXT: jae .LBB3_7
117 ; CHECK-NEXT: .LBB3_1:
118 ; CHECK-NEXT: jne .LBB3_2
121 ; CHECK-NEXT: .LBB3_7:
122 ; CHECK-NEXT: jne .LBB3_8
125 ; CHECK-NEXT: .LBB3_2:
126 ; CHECK-NEXT: leaq g+7(%rip), %r11
127 ; CHECK-NEXT: cmpq %r11, %r10
128 ; CHECK-NEXT: jae .LBB3_3
131 ; CHECK-NEXT: .LBB3_8:
132 ; CHECK-NEXT: leaq g+3(%rip), %r11
133 ; CHECK-NEXT: cmpq %r11, %r10
134 ; CHECK-NEXT: jae .LBB3_9
137 ; CHECK-NEXT: .LBB3_3:
138 ; CHECK-NEXT: jne .LBB3_4
141 ; CHECK-NEXT: .LBB3_9:
142 ; CHECK-NEXT: jne .LBB3_10
145 ; CHECK-NEXT: .LBB3_4:
146 ; CHECK-NEXT: leaq g+9(%rip), %r11
147 ; CHECK-NEXT: cmpq %r11, %r10
148 ; CHECK-NEXT: jae .LBB3_5
151 ; CHECK-NEXT: .LBB3_10:
153 ; CHECK-NEXT: .LBB3_5:
155 musttail call void (...) @llvm.icall.branch.funnel(
157 i8* getelementptr (i8, i8* @g, i64 0), void ()* @f0,
158 i8* getelementptr (i8, i8* @g, i64 1), void ()* @f1,
159 i8* getelementptr (i8, i8* @g, i64 2), void ()* @f2,
160 i8* getelementptr (i8, i8* @g, i64 3), void ()* @f3,
161 i8* getelementptr (i8, i8* @g, i64 4), void ()* @f4,
162 i8* getelementptr (i8, i8* @g, i64 5), void ()* @f5,
163 i8* getelementptr (i8, i8* @g, i64 6), void ()* @f6,
164 i8* getelementptr (i8, i8* @g, i64 7), void ()* @f7,
165 i8* getelementptr (i8, i8* @g, i64 8), void ()* @f8,
166 i8* getelementptr (i8, i8* @g, i64 9), void ()* @f9,