summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-10-19 20:43:44 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-10-19 20:43:44 +0000
commit0aae4bd0fc9133ba3b4e59d6cdb05b878fc8f436 (patch)
treead9ce31279574e965cf4603e2fa6385505f6f892 /test/Transforms
parent28ce1cc183582e4061f1e5ba4fb443d99a4915ae (diff)
downloadllvm-0aae4bd0fc9133ba3b4e59d6cdb05b878fc8f436.tar.gz
llvm-0aae4bd0fc9133ba3b4e59d6cdb05b878fc8f436.tar.bz2
llvm-0aae4bd0fc9133ba3b4e59d6cdb05b878fc8f436.tar.xz
SimplifyLibcalls: The return value of ffsll is always i32, even when the input is zero.
Fixes PR13028. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166313 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/SimplifyLibCalls/FFS.ll15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/Transforms/SimplifyLibCalls/FFS.ll b/test/Transforms/SimplifyLibCalls/FFS.ll
index e38d78349d..6aecbeacd7 100644
--- a/test/Transforms/SimplifyLibCalls/FFS.ll
+++ b/test/Transforms/SimplifyLibCalls/FFS.ll
@@ -1,6 +1,7 @@
-; Test that the ToAsciiOptimizer works correctly
-; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: not grep "call.*@ffs"
+; Test that FFSOpt works correctly
+; RUN: opt < %s -simplify-libcalls -S | FileCheck %s
+
+; CHECK-NOT: call{{.*}}@ffs
@non_const = external global i32 ; <i32*> [#uses=1]
@@ -34,3 +35,11 @@ define i32 @a(i64) nounwind {
%2 = call i32 @ffsll(i64 %0) ; <i32> [#uses=1]
ret i32 %2
}
+
+; PR13028
+define i32 @b() nounwind {
+ %ffs = call i32 @ffsll(i64 0)
+ ret i32 %ffs
+; CHECK: @b
+; CHECK-NEXT: ret i32 0
+}