diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2013-04-17 02:01:10 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2013-04-17 02:01:10 +0000 |
commit | c7ab4f99beceef00525f9a7df9ef58e63225cc7f (patch) | |
tree | 78225ec0f6ccf7432281fd6dfa3f3609f30ee2dd /test/Transforms | |
parent | 8afc8b7e63d5ce2d027e92934d16b19e5ba2db59 (diff) | |
download | external_llvm-c7ab4f99beceef00525f9a7df9ef58e63225cc7f.zip external_llvm-c7ab4f99beceef00525f9a7df9ef58e63225cc7f.tar.gz external_llvm-c7ab4f99beceef00525f9a7df9ef58e63225cc7f.tar.bz2 |
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')
-rw-r--r-- | test/Transforms/InstCombine/fprintf-1.ll | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fprintf-1.ll b/test/Transforms/InstCombine/fprintf-1.ll index 39d86b4..e1dc191 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 +} |