summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/divmod.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-04-01 06:27:25 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-04-01 06:27:25 +0000
commita6a992a6627f911cc14ec7c82a3028dc96dd9a14 (patch)
treedea7f94996b83ae97f4f4af42f37ad953c78e3ce /llvm/test/CodeGen/ARM/divmod.ll
parent0f86d6de5018ff948ed9ba99c6026e732273d04d (diff)
downloadbcm5719-llvm-a6a992a6627f911cc14ec7c82a3028dc96dd9a14.tar.gz
bcm5719-llvm-a6a992a6627f911cc14ec7c82a3028dc96dd9a14.zip
Add test case.
llvm-svn: 128707
Diffstat (limited to 'llvm/test/CodeGen/ARM/divmod.ll')
-rw-r--r--llvm/test/CodeGen/ARM/divmod.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/divmod.ll b/llvm/test/CodeGen/ARM/divmod.ll
new file mode 100644
index 00000000000..9b5129771f8
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/divmod.ll
@@ -0,0 +1,27 @@
+; RUN: llc < %s -mtriple=arm-apple-darwin -arm-divmod-libcall | FileCheck %s
+
+define void @foo(i32 %x, i32 %y, i32* nocapture %P) nounwind ssp {
+entry:
+; CHECK: foo:
+; CHECK: bl ___divmodsi4
+; CHECK-NOT: bl ___divmodsi4
+ %div = sdiv i32 %x, %y
+ store i32 %div, i32* %P, align 4
+ %rem = srem i32 %x, %y
+ %arrayidx6 = getelementptr inbounds i32* %P, i32 1
+ store i32 %rem, i32* %arrayidx6, align 4
+ ret void
+}
+
+define void @bar(i32 %x, i32 %y, i32* nocapture %P) nounwind ssp {
+entry:
+; CHECK: bar:
+; CHECK: bl ___udivmodsi4
+; CHECK-NOT: bl ___udivmodsi4
+ %div = udiv i32 %x, %y
+ store i32 %div, i32* %P, align 4
+ %rem = urem i32 %x, %y
+ %arrayidx6 = getelementptr inbounds i32* %P, i32 1
+ store i32 %rem, i32* %arrayidx6, align 4
+ ret void
+}
OpenPOWER on IntegriCloud