X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=test%2FTransforms%2FInstCombine%2Fobjsize.ll;h=cd7b7c80679b9ac913a2087eadc91338b36383df;hp=57dc2fd054428af8cc0b8c0bf879b784c05e8100;hb=687fed3530366b03a9a6433df0c032247ab17d5b;hpb=dd8187a3e9509c670162b6ae8b7115723a37f01c diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll index 57dc2fd0544..cd7b7c80679 100644 --- a/test/Transforms/InstCombine/objsize.ll +++ b/test/Transforms/InstCombine/objsize.ll @@ -118,8 +118,24 @@ entry: ret i32 0 } +@s = external global i8* + +define void @test5(i32 %n) nounwind ssp { +; CHECK: @test5 +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 10, i32 20) + %3 = tail call i8* @__memcpy_chk(i8* %0, i8* %2, i32 10, i32 %1) nounwind + ret void +} + declare i8* @__memset_chk(i8*, i32, i64, i64) nounwind +declare noalias i8* @malloc(i32) nounwind + declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readonly