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(ptr 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(
30 ptr getelementptr (i8, ptr @g, i64 1), ptr @f1,
36 define void @jt3(ptr 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(
52 ptr getelementptr (i8, ptr @g, i64 2), ptr @f2,
53 ptr getelementptr (i8, ptr @g, i64 1), ptr @f1,
59 define void @jt7(ptr 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(
95 ptr getelementptr (i8, ptr @g, i64 1), ptr @f1,
96 ptr getelementptr (i8, ptr @g, i64 2), ptr @f2,
97 ptr getelementptr (i8, ptr @g, i64 3), ptr @f3,
98 ptr getelementptr (i8, ptr @g, i64 4), ptr @f4,
99 ptr getelementptr (i8, ptr @g, i64 5), ptr @f5,
100 ptr getelementptr (i8, ptr @g, i64 6), ptr @f6,
106 define void @jt10(ptr 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(
158 ptr getelementptr (i8, ptr @g, i64 1), ptr @f1,
159 ptr getelementptr (i8, ptr @g, i64 2), ptr @f2,
160 ptr getelementptr (i8, ptr @g, i64 3), ptr @f3,
161 ptr getelementptr (i8, ptr @g, i64 4), ptr @f4,
162 ptr getelementptr (i8, ptr @g, i64 5), ptr @f5,
163 ptr getelementptr (i8, ptr @g, i64 6), ptr @f6,
164 ptr getelementptr (i8, ptr @g, i64 7), ptr @f7,
165 ptr getelementptr (i8, ptr @g, i64 8), ptr @f8,
166 ptr getelementptr (i8, ptr @g, i64 9), ptr @f9,