aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/SimplifyLibCalls/Puts.ll
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-04-29 10:10:17 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-04-29 10:10:17 +0000
commitb2825216a4bc8b5557b32fd340fc13aeb79a62d4 (patch)
tree97501ea2e8fbc960bf8f404d898c292f62944730 /test/Transforms/SimplifyLibCalls/Puts.ll
parentff5525daf30eeb70cb2331e9d94eef8caa61da11 (diff)
downloadexternal_llvm-b2825216a4bc8b5557b32fd340fc13aeb79a62d4.zip
external_llvm-b2825216a4bc8b5557b32fd340fc13aeb79a62d4.tar.gz
external_llvm-b2825216a4bc8b5557b32fd340fc13aeb79a62d4.tar.bz2
Actually make this pass test something related to fputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21619 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SimplifyLibCalls/Puts.ll')
-rw-r--r--test/Transforms/SimplifyLibCalls/Puts.ll22
1 files changed, 16 insertions, 6 deletions
diff --git a/test/Transforms/SimplifyLibCalls/Puts.ll b/test/Transforms/SimplifyLibCalls/Puts.ll
index 3bbc70e..ce7873f 100644
--- a/test/Transforms/SimplifyLibCalls/Puts.ll
+++ b/test/Transforms/SimplifyLibCalls/Puts.ll
@@ -1,16 +1,26 @@
; Test that the StrCatOptimizer works correctly
-; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*fputc'
+; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*fputs'
+;
%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 %fputs(sbyte*, %struct._IO_FILE*)
+
+%empty = constant [1 x sbyte] c"\00"
+%len1 = constant [2 x sbyte] c"A\00"
+%long = constant [7 x sbyte] c"hello\0A\00"
-declare int %fputc(int, %struct._IO_FILE*)
+implementation ; Functions:
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
+ %out = load %struct._IO_FILE** %stdout
+ %s1 = getelementptr [1 x sbyte]* %empty, int 0, int 0
+ %s2 = getelementptr [2 x sbyte]* %len1, int 0, int 0
+ %s3 = getelementptr [7 x sbyte]* %long, int 0, int 0
+ %a = call int %fputs( sbyte* %s1, %struct._IO_FILE* %out )
+ %b = call int %fputs( sbyte* %s2, %struct._IO_FILE* %out )
+ %c = call int %fputs( sbyte* %s3, %struct._IO_FILE* %out )
+ ret int 0
}