[llvm-commits] [llvm] r128707 - /llvm/trunk/test/CodeGen/ARM/divmod.ll

Evan Cheng evan.cheng at apple.com
Thu Mar 31 23:27:25 PDT 2011


Author: evancheng
Date: Fri Apr  1 01:27:25 2011
New Revision: 128707

URL: http://llvm.org/viewvc/llvm-project?rev=128707&view=rev
Log:
Add test case.

Added:
    llvm/trunk/test/CodeGen/ARM/divmod.ll

Added: llvm/trunk/test/CodeGen/ARM/divmod.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/divmod.ll?rev=128707&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/divmod.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/divmod.ll Fri Apr  1 01:27:25 2011
@@ -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
+}





More information about the llvm-commits mailing list