summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/fprintf-1.ll
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-04-17 02:01:10 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-04-17 02:01:10 +0000
commitc7ab4f99beceef00525f9a7df9ef58e63225cc7f (patch)
tree78225ec0f6ccf7432281fd6dfa3f3609f30ee2dd /test/Transforms/InstCombine/fprintf-1.ll
parent8afc8b7e63d5ce2d027e92934d16b19e5ba2db59 (diff)
downloadllvm-c7ab4f99beceef00525f9a7df9ef58e63225cc7f.tar.gz
llvm-c7ab4f99beceef00525f9a7df9ef58e63225cc7f.tar.bz2
llvm-c7ab4f99beceef00525f9a7df9ef58e63225cc7f.tar.xz
Do not optimise fprintf() calls if its return value is used.
Differential Revision: http://llvm-reviews.chandlerc.com/D620 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/fprintf-1.ll')
-rw-r--r--test/Transforms/InstCombine/fprintf-1.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fprintf-1.ll b/test/Transforms/InstCombine/fprintf-1.ll
index 39d86b4588..e1dc191bd7 100644
--- a/test/Transforms/InstCombine/fprintf-1.ll
+++ b/test/Transforms/InstCombine/fprintf-1.ll
@@ -78,3 +78,12 @@ define void @test_no_simplify2(%FILE* %fp, double %d) {
ret void
; CHECK-NEXT: ret void
}
+
+define i32 @test_no_simplify3(%FILE* %fp) {
+; CHECK: @test_no_simplify3
+ %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0
+ %1 = call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt)
+; CHECK-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([13 x i8]* @hello_world, i32 0, i32 0))
+ ret i32 %1
+; CHECK-NEXT: ret i32 %1
+}