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