aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-05-14 16:44:43 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-05-14 16:44:43 +0000
commitc6e3d5ea2edc680fe601aa0d03d879ee042f60d3 (patch)
tree1ff962848a96b0cf90c6df1648fa79ba3479a1a4
parentc29b13d6486ceb2453f16d17f6cd44af55f706cc (diff)
Add a test case for testing ffs libcall conversion to constant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22028 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/SimplifyLibCalls/FFS.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyLibCalls/FFS.ll b/test/Transforms/SimplifyLibCalls/FFS.ll
new file mode 100644
index 0000000000..35b5d3fb6c
--- /dev/null
+++ b/test/Transforms/SimplifyLibCalls/FFS.ll
@@ -0,0 +1,23 @@
+; Test that the ToAsciiOptimizer works correctly
+; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*%ffs'
+
+declare int %ffs(int)
+declare int %ffsl(int)
+declare int %ffsll(long)
+
+implementation ; Functions:
+
+int %main () {
+ %val1 = call int %ffs(int 1)
+ %val2 = call int %ffs(int 2048)
+ %val3 = call int %ffsl(int 65536)
+ %val4 = call int %ffsll(long 1024)
+ %val5 = call int %ffsll(long 17179869184)
+ %val6 = call int %ffsll(long 1152921504606846976)
+ %rslt1 = add int %val1, %val2
+ %rslt2 = add int %val3, %val4
+ %rslt3 = add int %val5, %val6
+ %rslt4 = add int %rslt1, %rslt2
+ %rslt5 = add int %rslt4, %rslt3
+ ret int %rslt5
+}