summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-03-23 06:06:09 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-03-23 06:06:09 +0000
commit3f7842232e853834a7338933663cc77ee0089b7f (patch)
treeb5d3de964f1cf2e5242f98f30e552c6e7cdc8bef /llvm/test/Transforms
parent340861d29e954e9428c32856d03b3fb01aa5d864 (diff)
downloadbcm5719-llvm-3f7842232e853834a7338933663cc77ee0089b7f.tar.gz
bcm5719-llvm-3f7842232e853834a7338933663cc77ee0089b7f.zip
Fix an incorrect logic causing instcombine to miss some _chk -> non-chk transformations.
llvm-svn: 99263
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/objsize.ll15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstCombine/objsize.ll b/llvm/test/Transforms/InstCombine/objsize.ll
index cd7b7c80679..f8b2ffca01e 100644
--- a/llvm/test/Transforms/InstCombine/objsize.ll
+++ b/llvm/test/Transforms/InstCombine/objsize.ll
@@ -118,6 +118,7 @@ entry:
ret i32 0
}
+; rdar://7782496
@s = external global i8*
define void @test5(i32 %n) nounwind ssp {
@@ -127,11 +128,23 @@ entry:
%1 = tail call i32 @llvm.objectsize.i32(i8* %0, i1 false)
%2 = load i8** @s, align 8
; CHECK-NOT: @llvm.objectsize
-; CHECK: @__memcpy_chk(i8* %0, i8* %1, i32 10, i32 20)
+; CHECK: @llvm.memcpy.i32(i8* %0, i8* %1, i32 10, i32 1)
%3 = tail call i8* @__memcpy_chk(i8* %0, i8* %2, i32 10, i32 %1) nounwind
ret void
}
+define void @test6(i32 %n) nounwind ssp {
+; CHECK: @test6
+entry:
+ %0 = tail call noalias i8* @malloc(i32 20) nounwind
+ %1 = tail call i32 @llvm.objectsize.i32(i8* %0, i1 false)
+ %2 = load i8** @s, align 8
+; CHECK-NOT: @llvm.objectsize
+; CHECK: @__memcpy_chk(i8* %0, i8* %1, i32 30, i32 20)
+ %3 = tail call i8* @__memcpy_chk(i8* %0, i8* %2, i32 30, i32 %1) nounwind
+ ret void
+}
+
declare i8* @__memset_chk(i8*, i32, i64, i64) nounwind
declare noalias i8* @malloc(i32) nounwind
OpenPOWER on IntegriCloud