summaryrefslogtreecommitdiffstats
path: root/test/Transforms/SimplifyLibCalls
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/SimplifyLibCalls')
-rw-r--r--test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll6
-rw-r--r--test/Transforms/SimplifyLibCalls/2009-02-12-StrTo.ll8
-rw-r--r--test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/FFS.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/FPrintF.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/FPuts.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/MemCpy.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/SPrintF.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/StpCpy.ll43
-rw-r--r--test/Transforms/SimplifyLibCalls/StrCat.ll4
-rw-r--r--test/Transforms/SimplifyLibCalls/StrLen.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/StrNCat.ll4
-rw-r--r--test/Transforms/SimplifyLibCalls/StrNCpy.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/ToAscii.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/abs.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/exp2.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/memmove.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/memset-64.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/memset.ll2
-rw-r--r--test/Transforms/SimplifyLibCalls/pow2.ll2
20 files changed, 69 insertions, 26 deletions
diff --git a/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll b/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll
index 8e9f206..ae917f7 100644
--- a/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll
+++ b/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll
@@ -1,8 +1,8 @@
; PR1307
; RUN: opt < %s -simplify-libcalls -instcombine -S > %t
-; RUN: grep {@str,.*i64 3} %t
-; RUN: grep {@str1,.*i64 7} %t
-; RUN: grep {ret i8.*null} %t
+; RUN: grep "@str,.*i64 3" %t
+; RUN: grep "@str1,.*i64 7" %t
+; RUN: grep "ret i8.*null" %t
; END.
@str = internal constant [5 x i8] c"foog\00"
diff --git a/test/Transforms/SimplifyLibCalls/2009-02-12-StrTo.ll b/test/Transforms/SimplifyLibCalls/2009-02-12-StrTo.ll
index f8a0c88..2717228 100644
--- a/test/Transforms/SimplifyLibCalls/2009-02-12-StrTo.ll
+++ b/test/Transforms/SimplifyLibCalls/2009-02-12-StrTo.ll
@@ -1,14 +1,14 @@
-; RUN: opt < %s -simplify-libcalls -S > %t
-; RUN: grep nocapture %t | count 2
-; RUN: grep null %t | grep nocapture | count 1
-; RUN: grep null %t | grep call | not grep readonly
+; RUN: opt < %s -simplify-libcalls -S | FileCheck %s
; Test that we add nocapture to the declaration, and to the second call only.
+; CHECK: declare float @strtol(i8*, i8** nocapture, i32) nounwind
declare float @strtol(i8* %s, i8** %endptr, i32 %base)
define void @foo(i8* %x, i8** %endptr) {
+; CHECK: call float @strtol(i8* %x, i8** %endptr, i32 10)
call float @strtol(i8* %x, i8** %endptr, i32 10)
+; CHECK: %2 = call float @strtol(i8* nocapture %x, i8** null, i32 10)
call float @strtol(i8* %x, i8** null, i32 10)
ret void
}
diff --git a/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll b/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll
index 9056499..f4c80ed 100644
--- a/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll
+++ b/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -simplify-libcalls -instcombine -S | grep {ret i32 -65}
+; RUN: opt < %s -simplify-libcalls -instcombine -S | grep "ret i32 -65"
; PR4284
define i32 @test() nounwind {
diff --git a/test/Transforms/SimplifyLibCalls/FFS.ll b/test/Transforms/SimplifyLibCalls/FFS.ll
index ab45f18..e38d783 100644
--- a/test/Transforms/SimplifyLibCalls/FFS.ll
+++ b/test/Transforms/SimplifyLibCalls/FFS.ll
@@ -1,6 +1,6 @@
; Test that the ToAsciiOptimizer works correctly
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: not grep {call.*@ffs}
+; RUN: not grep "call.*@ffs"
@non_const = external global i32 ; <i32*> [#uses=1]
diff --git a/test/Transforms/SimplifyLibCalls/FPrintF.ll b/test/Transforms/SimplifyLibCalls/FPrintF.ll
index 4a0d232..51733e4 100644
--- a/test/Transforms/SimplifyLibCalls/FPrintF.ll
+++ b/test/Transforms/SimplifyLibCalls/FPrintF.ll
@@ -1,6 +1,6 @@
; Test that the FPrintFOptimizer works correctly
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: not grep {call.*fprintf}
+; RUN: not grep "call.*fprintf"
; This transformation requires the pointer size, as it assumes that size_t is
; the size of a pointer.
diff --git a/test/Transforms/SimplifyLibCalls/FPuts.ll b/test/Transforms/SimplifyLibCalls/FPuts.ll
index 1f72ede..aa01aba 100644
--- a/test/Transforms/SimplifyLibCalls/FPuts.ll
+++ b/test/Transforms/SimplifyLibCalls/FPuts.ll
@@ -1,6 +1,6 @@
; Test that the FPutsOptimizer works correctly
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: not grep {call.*fputs}
+; RUN: not grep "call.*fputs"
; This transformation requires the pointer size, as it assumes that size_t is
; the size of a pointer.
diff --git a/test/Transforms/SimplifyLibCalls/MemCpy.ll b/test/Transforms/SimplifyLibCalls/MemCpy.ll
index c711178..1faad03 100644
--- a/test/Transforms/SimplifyLibCalls/MemCpy.ll
+++ b/test/Transforms/SimplifyLibCalls/MemCpy.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -constprop -instcombine -S | not grep {call.*llvm.memcpy.i32}
+; RUN: opt < %s -constprop -instcombine -S | not grep "call.*llvm.memcpy.i32"
@h = constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1]
@hel = constant [4 x i8] c"hel\00" ; <[4 x i8]*> [#uses=1]
diff --git a/test/Transforms/SimplifyLibCalls/SPrintF.ll b/test/Transforms/SimplifyLibCalls/SPrintF.ll
index 847e363..514a7d9 100644
--- a/test/Transforms/SimplifyLibCalls/SPrintF.ll
+++ b/test/Transforms/SimplifyLibCalls/SPrintF.ll
@@ -1,6 +1,6 @@
; Test that the SPrintFOptimizer works correctly
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: not grep {call.*sprintf}
+; RUN: not grep "call.*sprintf"
; This transformation requires the pointer size, as it assumes that size_t is
; the size of a pointer.
diff --git a/test/Transforms/SimplifyLibCalls/StpCpy.ll b/test/Transforms/SimplifyLibCalls/StpCpy.ll
new file mode 100644
index 0000000..914b095
--- /dev/null
+++ b/test/Transforms/SimplifyLibCalls/StpCpy.ll
@@ -0,0 +1,43 @@
+; Test that the StpCpyOptimizer works correctly
+; 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.
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
+
+@hello = constant [6 x i8] c"hello\00"
+
+declare i8* @stpcpy(i8*, i8*)
+
+declare i8* @__stpcpy_chk(i8*, i8*, i32) nounwind
+
+declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly
+
+define i32 @t1() {
+; CHECK: @t1
+ %target = alloca [1024 x i8]
+ %arg1 = getelementptr [1024 x i8]* %target, i32 0, i32 0
+ %arg2 = getelementptr [6 x i8]* @hello, i32 0, i32 0
+ %rslt1 = call i8* @stpcpy( i8* %arg1, i8* %arg2 )
+; CHECK: @llvm.memcpy.p0i8.p0i8.i32
+ ret i32 0
+}
+
+define i32 @t2() {
+; CHECK: @t2
+ %target = alloca [1024 x i8]
+ %arg1 = getelementptr [1024 x i8]* %target, i32 0, i32 0
+ %arg2 = getelementptr [6 x i8]* @hello, i32 0, i32 0
+ %tmp1 = call i32 @llvm.objectsize.i32(i8* %arg1, i1 false)
+ %rslt1 = call i8* @__stpcpy_chk(i8* %arg1, i8* %arg2, i32 %tmp1)
+; CHECK: @__memcpy_chk
+ ret i32 0
+}
+
+define i8* @t3(i8* %arg) {
+; CHECK: @t3
+ %stpcpy = tail call i8* @stpcpy(i8* %arg, i8* %arg)
+; CHECK: [[LEN:%[a-z]+]] = call i32 @strlen(i8* %arg)
+; CHECK-NEXT: getelementptr inbounds i8* %arg, i32 [[LEN]]
+ ret i8* %stpcpy
+}
diff --git a/test/Transforms/SimplifyLibCalls/StrCat.ll b/test/Transforms/SimplifyLibCalls/StrCat.ll
index 4e3d0ab..3ea691a 100644
--- a/test/Transforms/SimplifyLibCalls/StrCat.ll
+++ b/test/Transforms/SimplifyLibCalls/StrCat.ll
@@ -1,9 +1,9 @@
; Test that the StrCatOptimizer works correctly
; PR3661
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: not grep {call.*strcat}
+; RUN: not grep "call.*strcat"
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: grep {puts.*%arg1}
+; RUN: grep "puts.*%arg1"
; This transformation requires the pointer size, as it assumes that size_t is
; the size of a pointer.
diff --git a/test/Transforms/SimplifyLibCalls/StrLen.ll b/test/Transforms/SimplifyLibCalls/StrLen.ll
index acd8aaf..4a20bbd 100644
--- a/test/Transforms/SimplifyLibCalls/StrLen.ll
+++ b/test/Transforms/SimplifyLibCalls/StrLen.ll
@@ -1,6 +1,6 @@
; Test that the StrCatOptimizer works correctly
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: not grep {call.*strlen}
+; RUN: not grep "call.*strlen"
target datalayout = "e-p:32:32"
@hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=3]
diff --git a/test/Transforms/SimplifyLibCalls/StrNCat.ll b/test/Transforms/SimplifyLibCalls/StrNCat.ll
index d09c022..073792b 100644
--- a/test/Transforms/SimplifyLibCalls/StrNCat.ll
+++ b/test/Transforms/SimplifyLibCalls/StrNCat.ll
@@ -1,8 +1,8 @@
; Test that the StrNCatOptimizer works correctly
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: not grep {call.*strncat}
+; RUN: not grep "call.*strncat"
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: grep {puts.*%arg1}
+; RUN: grep "puts.*%arg1"
; This transformation requires the pointer size, as it assumes that size_t is
; the size of a pointer.
diff --git a/test/Transforms/SimplifyLibCalls/StrNCpy.ll b/test/Transforms/SimplifyLibCalls/StrNCpy.ll
index c8af3ca..4e47b31 100644
--- a/test/Transforms/SimplifyLibCalls/StrNCpy.ll
+++ b/test/Transforms/SimplifyLibCalls/StrNCpy.ll
@@ -1,6 +1,6 @@
; Test that the StrNCpyOptimizer works correctly
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: not grep {call.*strncpy}
+; RUN: not grep "call.*strncpy"
; This transformation requires the pointer size, as it assumes that size_t is
; the size of a pointer.
diff --git a/test/Transforms/SimplifyLibCalls/ToAscii.ll b/test/Transforms/SimplifyLibCalls/ToAscii.ll
index e2b5683..aef4733 100644
--- a/test/Transforms/SimplifyLibCalls/ToAscii.ll
+++ b/test/Transforms/SimplifyLibCalls/ToAscii.ll
@@ -1,6 +1,6 @@
; Test that the ToAsciiOptimizer works correctly
; RUN: opt < %s -simplify-libcalls -S | \
-; RUN: not grep {call.*toascii}
+; RUN: not grep "call.*toascii"
declare i32 @toascii(i32)
diff --git a/test/Transforms/SimplifyLibCalls/abs.ll b/test/Transforms/SimplifyLibCalls/abs.ll
index 6fbe0b9..3934a5b 100644
--- a/test/Transforms/SimplifyLibCalls/abs.ll
+++ b/test/Transforms/SimplifyLibCalls/abs.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -simplify-libcalls -S | grep {select i1 %ispos}
+; RUN: opt < %s -simplify-libcalls -S | grep "select i1 %ispos"
; PR2337
define i32 @test(i32 %x) {
diff --git a/test/Transforms/SimplifyLibCalls/exp2.ll b/test/Transforms/SimplifyLibCalls/exp2.ll
index 2f5d910..a592775 100644
--- a/test/Transforms/SimplifyLibCalls/exp2.ll
+++ b/test/Transforms/SimplifyLibCalls/exp2.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -simplify-libcalls -S | grep {call.*ldexp} | count 4
+; RUN: opt < %s -simplify-libcalls -S | grep "call.*ldexp" | count 4
; rdar://5852514
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
diff --git a/test/Transforms/SimplifyLibCalls/memmove.ll b/test/Transforms/SimplifyLibCalls/memmove.ll
index c0c0050..5aaeeeb 100644
--- a/test/Transforms/SimplifyLibCalls/memmove.ll
+++ b/test/Transforms/SimplifyLibCalls/memmove.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -simplify-libcalls -S | grep {llvm.memmove}
+; RUN: opt < %s -simplify-libcalls -S | grep "llvm.memmove"
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i686-pc-linux-gnu"
diff --git a/test/Transforms/SimplifyLibCalls/memset-64.ll b/test/Transforms/SimplifyLibCalls/memset-64.ll
index fb752c4..92412de 100644
--- a/test/Transforms/SimplifyLibCalls/memset-64.ll
+++ b/test/Transforms/SimplifyLibCalls/memset-64.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -simplify-libcalls -S | grep {llvm.memset}
+; RUN: opt < %s -simplify-libcalls -S | grep "llvm.memset"
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-pc-linux-gnu"
diff --git a/test/Transforms/SimplifyLibCalls/memset.ll b/test/Transforms/SimplifyLibCalls/memset.ll
index 0aede06..853215a 100644
--- a/test/Transforms/SimplifyLibCalls/memset.ll
+++ b/test/Transforms/SimplifyLibCalls/memset.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -simplify-libcalls -S | grep {llvm.memset}
+; RUN: opt < %s -simplify-libcalls -S | grep "llvm.memset"
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i686-pc-linux-gnu"
diff --git a/test/Transforms/SimplifyLibCalls/pow2.ll b/test/Transforms/SimplifyLibCalls/pow2.ll
index f8364f7..f0964e7 100644
--- a/test/Transforms/SimplifyLibCalls/pow2.ll
+++ b/test/Transforms/SimplifyLibCalls/pow2.ll
@@ -1,6 +1,6 @@
; Testcase for calls to the standard C "pow" function
;
-; RUN: opt < %s -simplify-libcalls -S | not grep {call .pow}
+; RUN: opt < %s -simplify-libcalls -S | not grep "call .pow"
declare double @pow(double, double)
OpenPOWER on IntegriCloud