summaryrefslogtreecommitdiff
path: root/test
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
commit5b76c63f835640bae7237f6dd6582e3d24a0b9b1 (patch)
tree6f4409120f4450238ea7eac390a8770de9647e9b /test
parentdf269b9129cbeee54f9573275e850e6ca71bf973 (diff)
downloadllvm-5b76c63f835640bae7237f6dd6582e3d24a0b9b1.tar.gz
llvm-5b76c63f835640bae7237f6dd6582e3d24a0b9b1.tar.bz2
llvm-5b76c63f835640bae7237f6dd6582e3d24a0b9b1.tar.xz
Add test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128707 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/ARM/divmod.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/divmod.ll b/test/CodeGen/ARM/divmod.ll
new file mode 100644
index 0000000000..9b5129771f
--- /dev/null
+++ b/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
+}