From 1db3152ddee056c2433ec29e3286e625ff6ae6f5 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Tue, 27 Nov 2012 08:18:23 +0000 Subject: [PATCH] llvm/test/Transforms/SimplifyLibCalls: FileCheck-ize 3 tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168691 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/SimplifyLibCalls/FPrintF.ll | 6 ++++-- test/Transforms/SimplifyLibCalls/FPuts.ll | 6 ++++-- test/Transforms/SimplifyLibCalls/SPrintF.ll | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/test/Transforms/SimplifyLibCalls/FPrintF.ll b/test/Transforms/SimplifyLibCalls/FPrintF.ll index 100f31e54e7..d1410a94686 100644 --- a/test/Transforms/SimplifyLibCalls/FPrintF.ll +++ b/test/Transforms/SimplifyLibCalls/FPrintF.ll @@ -1,6 +1,5 @@ ; Test that the FPrintFOptimizer works correctly -; RUN: opt < %s -simplify-libcalls -S | \ -; RUN: not grep "call.*fprintf" +; RUN: opt < %s -simplify-libcalls -S | FileCheck %s ; This transformation requires the pointer size, as it assumes that size_t is ; the size of a pointer. @@ -15,6 +14,7 @@ target datalayout = "p:64:64:64" declare i32 @fprintf(%struct._IO_FILE*, i8*, ...) +; CHECK: define i32 @foo() { define i32 @foo() { entry: %tmp.1 = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=1] @@ -24,4 +24,6 @@ entry: %tmp.8 = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=1] %tmp.7 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf( %struct._IO_FILE* %tmp.8, i8* getelementptr ([3 x i8]* @chr, i32 0, i32 0), i32 33 ) ; [#uses=0] ret i32 0 + +; CHECK-NOT: @fprintf( } diff --git a/test/Transforms/SimplifyLibCalls/FPuts.ll b/test/Transforms/SimplifyLibCalls/FPuts.ll index c3ca4a51588..a6efc0fb964 100644 --- a/test/Transforms/SimplifyLibCalls/FPuts.ll +++ b/test/Transforms/SimplifyLibCalls/FPuts.ll @@ -1,6 +1,5 @@ ; Test that the FPutsOptimizer works correctly -; RUN: opt < %s -simplify-libcalls -S | \ -; RUN: not grep "call.*fputs" +; RUN: opt < %s -simplify-libcalls -S | FileCheck %s ; This transformation requires the pointer size, as it assumes that size_t is ; the size of a pointer. @@ -16,6 +15,7 @@ target datalayout = "p:64:64:64" declare i32 @fputs(i8*, %struct._IO_FILE*) define i32 @main() { +; CHECK: define i32 @main() { entry: %out = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=3] %s1 = getelementptr [1 x i8]* @empty, i32 0, i32 0 ; [#uses=1] @@ -25,4 +25,6 @@ entry: %b = call i32 @fputs( i8* %s2, %struct._IO_FILE* %out ) ; [#uses=0] %c = call i32 @fputs( i8* %s3, %struct._IO_FILE* %out ) ; [#uses=0] ret i32 0 + +; CHECK-NOT: @fputs( } diff --git a/test/Transforms/SimplifyLibCalls/SPrintF.ll b/test/Transforms/SimplifyLibCalls/SPrintF.ll index 1e65b5b17a6..a0b7fdd00ea 100644 --- a/test/Transforms/SimplifyLibCalls/SPrintF.ll +++ b/test/Transforms/SimplifyLibCalls/SPrintF.ll @@ -1,6 +1,5 @@ ; Test that the SPrintFOptimizer works correctly -; RUN: opt < %s -instcombine -S | \ -; RUN: not grep "call.*sprintf" +; RUN: opt < %s -instcombine -S | FileCheck %s ; This transformation requires the pointer size, as it assumes that size_t is ; the size of a pointer. @@ -17,6 +16,7 @@ declare i32 @sprintf(i8*, i8*, ...) declare i32 @puts(i8*) define i32 @foo(i8* %p) { +; CHECK: define i32 @foo(i8* %p) { %target = alloca [1024 x i8] ; <[1024 x i8]*> [#uses=1] %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0 ; [#uses=7] %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 ; [#uses=2] @@ -37,4 +37,6 @@ define i32 @foo(i8* %p) { %r9 = add i32 %r8, %r4 ; [#uses=1] %r10 = add i32 %r9, %r4.1 ; [#uses=1] ret i32 %r10 + +; CHECK-NOT: @sprintf( } -- 2.34.1