1 ; Test all condition-code masks that are relevant for CRJ. 2 ; 3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s 4 5 declare i32 @foo() 6 7 define void @f1(i32 %target) { 8 ; CHECK-LABEL: f1: 9 ; CHECK: .cfi_def_cfa_offset 10 ; CHECK: .L[[LABEL:.*]]: 11 ; CHECK: crje %r2, {{%r[0-9]+}}, .L[[LABEL]] 12 br label %loop 13 loop: 14 %val = call i32 @foo() 15 %cond = icmp eq i32 %val, %target 16 br i1 %cond, label %loop, label %exit 17 exit: 18 ret void 19 } 20 21 define void @f2(i32 %target) { 22 ; CHECK-LABEL: f2: 23 ; CHECK: .cfi_def_cfa_offset 24 ; CHECK: .L[[LABEL:.*]]: 25 ; CHECK: crjlh %r2, {{%r[0-9]+}}, .L[[LABEL]] 26 br label %loop 27 loop: 28 %val = call i32 @foo() 29 %cond = icmp ne i32 %val, %target 30 br i1 %cond, label %loop, label %exit 31 exit: 32 ret void 33 } 34 35 define void @f3(i32 %target) { 36 ; CHECK-LABEL: f3: 37 ; CHECK: .cfi_def_cfa_offset 38 ; CHECK: .L[[LABEL:.*]]: 39 ; CHECK: crjle %r2, {{%r[0-9]+}}, .L[[LABEL]] 40 br label %loop 41 loop: 42 %val = call i32 @foo() 43 %cond = icmp sle i32 %val, %target 44 br i1 %cond, label %loop, label %exit 45 exit: 46 ret void 47 } 48 49 define void @f4(i32 %target) { 50 ; CHECK-LABEL: f4: 51 ; CHECK: .cfi_def_cfa_offset 52 ; CHECK: .L[[LABEL:.*]]: 53 ; CHECK: crjl %r2, {{%r[0-9]+}}, .L[[LABEL]] 54 br label %loop 55 loop: 56 %val = call i32 @foo() 57 %cond = icmp slt i32 %val, %target 58 br i1 %cond, label %loop, label %exit 59 exit: 60 ret void 61 } 62 63 define void @f5(i32 %target) { 64 ; CHECK-LABEL: f5: 65 ; CHECK: .cfi_def_cfa_offset 66 ; CHECK: .L[[LABEL:.*]]: 67 ; CHECK: crjh %r2, {{%r[0-9]+}}, .L[[LABEL]] 68 br label %loop 69 loop: 70 %val = call i32 @foo() 71 %cond = icmp sgt i32 %val, %target 72 br i1 %cond, label %loop, label %exit 73 exit: 74 ret void 75 } 76 77 define void @f6(i32 %target) { 78 ; CHECK-LABEL: f6: 79 ; CHECK: .cfi_def_cfa_offset 80 ; CHECK: .L[[LABEL:.*]]: 81 ; CHECK: crjhe %r2, {{%r[0-9]+}}, .L[[LABEL]] 82 br label %loop 83 loop: 84 %val = call i32 @foo() 85 %cond = icmp sge i32 %val, %target 86 br i1 %cond, label %loop, label %exit 87 exit: 88 ret void 89 } 90