summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-04-20 01:19:45 +0000
committerEric Christopher <echristo@apple.com>2011-04-20 01:19:45 +0000
commitabbbfbd6726c7af8b27479b4311fe6bb6c40b52b (patch)
treef4850c27a0e5e47e2fef7471bfc9a29fd80e1d72 /test
parent0ccc0dde33ee78003367cb41a05156c16429dc71 (diff)
downloadllvm-abbbfbd6726c7af8b27479b4311fe6bb6c40b52b.tar.gz
llvm-abbbfbd6726c7af8b27479b4311fe6bb6c40b52b.tar.bz2
llvm-abbbfbd6726c7af8b27479b4311fe6bb6c40b52b.tar.xz
Rewrite the expander for umulo/smulo to remember to sign extend the input
manually and pass all (now) 4 arguments to the mul libcall. Add a new ExpandLibCall for just this (copied gratuitously from type legalization). Fixes rdar://9292577 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/ARM/umulo-32.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/umulo-32.ll b/test/CodeGen/ARM/umulo-32.ll
index aa7d28a623..fa5c0168fe 100644
--- a/test/CodeGen/ARM/umulo-32.ll
+++ b/test/CodeGen/ARM/umulo-32.ll
@@ -12,3 +12,30 @@ define i32 @func(i32 %a) nounwind {
}
declare %umul.ty @llvm.umul.with.overflow.i32(i32, i32) nounwind readnone
+
+define i32 @f(i32 %argc, i8** %argv) ssp {
+; CHECK: func
+; CHECK: str r0
+; CHECK: movs r2
+; CHECK: mov r1
+; CHECK: mov r3
+; CHECK: muldi3
+%1 = alloca i32, align 4
+%2 = alloca i32, align 4
+%3 = alloca i8**, align 4
+%m_degree = alloca i32, align 4
+store i32 0, i32* %1
+store i32 %argc, i32* %2, align 4
+store i8** %argv, i8*** %3, align 4
+store i32 10, i32* %m_degree, align 4
+%4 = load i32* %m_degree, align 4
+%5 = call %umul.ty @llvm.umul.with.overflow.i32(i32 %4, i32 8)
+%6 = extractvalue %umul.ty %5, 1
+%7 = extractvalue %umul.ty %5, 0
+%8 = select i1 %6, i32 -1, i32 %7
+%9 = call noalias i8* @_Znam(i32 %8)
+%10 = bitcast i8* %9 to double*
+ret i32 0
+}
+
+declare noalias i8* @_Znam(i32)