diff options
Diffstat (limited to 'test/Transforms/SimplifyLibCalls/fwrite.ll')
-rw-r--r-- | test/Transforms/SimplifyLibCalls/fwrite.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyLibCalls/fwrite.ll b/test/Transforms/SimplifyLibCalls/fwrite.ll new file mode 100644 index 0000000..f0f3dca --- /dev/null +++ b/test/Transforms/SimplifyLibCalls/fwrite.ll @@ -0,0 +1,13 @@ +; RUN: opt < %s -simplify-libcalls -S | FileCheck %s + +%FILE = type { i32 } + +@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 + +define i64 @foo(%FILE* %f) { +; CHECK: %retval = call i64 @fwrite + %retval = call i64 @fwrite(i8* getelementptr inbounds ([1 x i8]* @.str, i64 0, i64 0), i64 1, i64 1, %FILE* %f) + ret i64 %retval +} + +declare i64 @fwrite(i8*, i64, i64, %FILE *) |