summaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/GlobalISel/arm-isel.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/ARM/GlobalISel/arm-isel.ll')
-rw-r--r--test/CodeGen/ARM/GlobalISel/arm-isel.ll39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/GlobalISel/arm-isel.ll b/test/CodeGen/ARM/GlobalISel/arm-isel.ll
index 4c498ff6ca9b..419bcf71c106 100644
--- a/test/CodeGen/ARM/GlobalISel/arm-isel.ll
+++ b/test/CodeGen/ARM/GlobalISel/arm-isel.ll
@@ -420,3 +420,42 @@ entry:
%r = select i1 %cond, i32* %a, i32* %b
ret i32* %r
}
+
+define arm_aapcscc void @test_br() {
+; CHECK-LABEL: test_br
+; CHECK: [[LABEL:.L[[:alnum:]_]+]]:
+; CHECK: b [[LABEL]]
+entry:
+ br label %infinite
+
+infinite:
+ br label %infinite
+}
+
+declare arm_aapcscc void @brcond1()
+declare arm_aapcscc void @brcond2()
+
+define arm_aapcscc void @test_brcond(i32 %n) {
+; CHECK-LABEL: test_brcond
+; CHECK: cmp r0
+; CHECK-NEXT: movgt [[RCMP:r[0-9]+]], #1
+; CHECK: tst [[RCMP]], #1
+; CHECK-NEXT: bne [[FALSE:.L[[:alnum:]_]+]]
+; CHECK: blx brcond1
+; CHECK: [[FALSE]]:
+; CHECK: blx brcond2
+entry:
+ %cmp = icmp sgt i32 %n, 0
+ br i1 %cmp, label %if.true, label %if.false
+
+if.true:
+ call arm_aapcscc void @brcond1()
+ br label %if.end
+
+if.false:
+ call arm_aapcscc void @brcond2()
+ br label %if.end
+
+if.end:
+ ret void
+}