summaryrefslogtreecommitdiffstats
path: root/test/Transforms/SimplifyLibCalls
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-04-30 01:00:52 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-04-30 01:00:52 +0000
commitb2ae078c9a7704ffb4e8e037b96391782d8e12f4 (patch)
treecb92d57d74a336ffc63b18e5a2fbdfe0dc5061c3 /test/Transforms/SimplifyLibCalls
parent926bd0cc45145419ef59102b5d857b72ed1609a4 (diff)
downloadexternal_llvm-b2ae078c9a7704ffb4e8e037b96391782d8e12f4.zip
external_llvm-b2ae078c9a7704ffb4e8e037b96391782d8e12f4.tar.gz
external_llvm-b2ae078c9a7704ffb4e8e037b96391782d8e12f4.tar.bz2
A new test case for the ToAsciiOptimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SimplifyLibCalls')
-rw-r--r--test/Transforms/SimplifyLibCalls/ToAscii.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyLibCalls/ToAscii.ll b/test/Transforms/SimplifyLibCalls/ToAscii.ll
new file mode 100644
index 0000000..cb7d06c
--- /dev/null
+++ b/test/Transforms/SimplifyLibCalls/ToAscii.ll
@@ -0,0 +1,21 @@
+; Test that the ToAsciiOptimizer works correctly
+; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*toascii'
+
+declare int %toascii(int)
+
+implementation ; Functions:
+
+int %main () {
+ %val1 = call int %toascii(int 1)
+ %val2 = call int %toascii(int 0)
+ %val3 = call int %toascii(int 127)
+ %val4 = call int %toascii(int 128)
+ %val5 = call int %toascii(int 255)
+ %val6 = call int %toascii(int 256)
+ %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
+}