summaryrefslogtreecommitdiffstats
path: root/llvm/test/Regression/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
commit10e99b2667137d195ccfe1ae06b9736abbc283ae (patch)
treef779741d3174a1ff97a84e99ab29f34a94009d26 /llvm/test/Regression/Transforms/SimplifyLibCalls
parent89339ffb2254e9d47755e644985c17e66400c1c2 (diff)
downloadbcm5719-llvm-10e99b2667137d195ccfe1ae06b9736abbc283ae.tar.gz
bcm5719-llvm-10e99b2667137d195ccfe1ae06b9736abbc283ae.zip
A new test case for the ToAsciiOptimizer.
llvm-svn: 21624
Diffstat (limited to 'llvm/test/Regression/Transforms/SimplifyLibCalls')
-rw-r--r--llvm/test/Regression/Transforms/SimplifyLibCalls/ToAscii.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/Regression/Transforms/SimplifyLibCalls/ToAscii.ll b/llvm/test/Regression/Transforms/SimplifyLibCalls/ToAscii.ll
new file mode 100644
index 00000000000..cb7d06c701f
--- /dev/null
+++ b/llvm/test/Regression/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
+}
OpenPOWER on IntegriCloud