1; Test indirect jumps.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5define i32 @f1(i32 %x, i32 %y, i32 %op) {
6; CHECK-LABEL: f1:
7; CHECK: ahi %r4, -1
8; CHECK: clibh %r4, 5, 0(%r14)
9; CHECK: llgfr [[OP64:%r[0-5]]], %r4
10; CHECK: sllg [[INDEX:%r[1-5]]], [[OP64]], 3
11; CHECK: larl [[BASE:%r[1-5]]]
12; CHECK: lg [[TARGET:%r[1-5]]], 0([[BASE]],[[INDEX]])
13; CHECK: br [[TARGET]]
14entry:
15  switch i32 %op, label %exit [
16    i32 1, label %b.add
17    i32 2, label %b.sub
18    i32 3, label %b.and
19    i32 4, label %b.or
20    i32 5, label %b.xor
21    i32 6, label %b.mul
22  ]
23
24b.add:
25  %add = add i32 %x, %y
26  br label %exit
27
28b.sub:
29  %sub = sub i32 %x, %y
30  br label %exit
31
32b.and:
33  %and = and i32 %x, %y
34  br label %exit
35
36b.or:
37  %or = or i32 %x, %y
38  br label %exit
39
40b.xor:
41  %xor = xor i32 %x, %y
42  br label %exit
43
44b.mul:
45  %mul = mul i32 %x, %y
46  br label %exit
47
48exit:
49  %res = phi i32 [ %x,   %entry ],
50                 [ %add, %b.add ],
51                 [ %sub, %b.sub ],
52                 [ %and, %b.and ],
53                 [ %or,  %b.or ],
54                 [ %xor, %b.xor ],
55                 [ %mul, %b.mul ]
56  ret i32 %res
57}
58