diff options
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/SimplifyLibCalls/Puts.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyLibCalls/Puts.ll b/test/Transforms/SimplifyLibCalls/Puts.ll new file mode 100644 index 0000000000..48431434cc --- /dev/null +++ b/test/Transforms/SimplifyLibCalls/Puts.ll @@ -0,0 +1,15 @@ +; Test that the PutsOptimizer works correctly +; RUN: opt < %s -simplify-libcalls -S | FileCheck %s + +target datalayout = "-p:64:64:64" + +@.str = private constant [1 x i8] zeroinitializer + +declare i32 @puts(i8*) + +define void @foo() { +entry: +; CHECK: call i32 @putchar(i32 10) + %call = call i32 @puts(i8* getelementptr inbounds ([1 x i8]* @.str, i32 0, i32 0)) + ret void +} |