aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-04-29 07:19:00 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-04-29 07:19:00 +0000
commitbb4cae7d696c17bd2a968df9eb4ec7afa6c6ee61 (patch)
tree8a6602b9a2f70cf67d95e37dbdfc985692903bfe /test/Transforms
parent45254f7be069405a0707293370846d7e596fc8bc (diff)
downloadexternal_llvm-bb4cae7d696c17bd2a968df9eb4ec7afa6c6ee61.zip
external_llvm-bb4cae7d696c17bd2a968df9eb4ec7afa6c6ee61.tar.gz
external_llvm-bb4cae7d696c17bd2a968df9eb4ec7afa6c6ee61.tar.bz2
Add a test case for the puts libcall optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/SimplifyLibCalls/Puts.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyLibCalls/Puts.ll b/test/Transforms/SimplifyLibCalls/Puts.ll
new file mode 100644
index 0000000..3bbc70e
--- /dev/null
+++ b/test/Transforms/SimplifyLibCalls/Puts.ll
@@ -0,0 +1,16 @@
+; Test that the StrCatOptimizer works correctly
+; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*fputc'
+%struct._IO_FILE = type { int, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct._IO_marker*, %struct._IO_FILE*, int, int, int, ushort, sbyte, [1 x sbyte], sbyte*, long, sbyte*, sbyte*, int, [52 x sbyte] }
+%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, int }
+%stdout = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=1]
+
+implementation ; Functions:
+
+declare int %fputc(int, %struct._IO_FILE*)
+
+int %main() {
+entry:
+ %tmp.1 = load %struct._IO_FILE** %stdout ; <%struct._IO_FILE*> [#uses=1]
+ %tmp.0 = call int %fputc( int 61, %struct._IO_FILE* %tmp.1 ) ; <int> [#uses=0]
+ ret int 0
+}