aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/SimplifyLibCalls/ToAscii.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/SimplifyLibCalls/ToAscii.ll')
-rw-r--r--test/Transforms/SimplifyLibCalls/ToAscii.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyLibCalls/ToAscii.ll b/test/Transforms/SimplifyLibCalls/ToAscii.ll
new file mode 100644
index 0000000..0bc2664
--- /dev/null
+++ b/test/Transforms/SimplifyLibCalls/ToAscii.ll
@@ -0,0 +1,22 @@
+; Test that the ToAsciiOptimizer works correctly
+; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
+; RUN: 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
+}