1 ; Test SystemZInstrInfo::analyzeBranch and SystemZInstrInfo::insertBranch.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 declare void @foo() noreturn
7 ; Check a case where a separate branch is needed and where the original
8 ; order should be reversed.
9 define i32 @f1(i32 %a, i32 *%bptr) {
11 ; CHECK: cl %r2, 0(%r3)
12 ; CHECK: jl .L[[LABEL:.*]]
15 ; CHECK: brasl %r14, foo@PLT
17 %b = load i32, i32 *%bptr
18 %cmp = icmp ult i32 %a, %b
19 br i1 %cmp, label %callit, label %return
29 ; Same again with a fused compare and branch.
30 define i32 @f2(i32 %a) {
32 ; CHECK: cije %r2, 0, .L[[LABEL:.*]]
35 ; CHECK: brasl %r14, foo@PLT
37 %cmp = icmp eq i32 %a, 0
38 br i1 %cmp, label %callit, label %return