aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/objsize.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/objsize.ll')
-rw-r--r--test/Transforms/InstCombine/objsize.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll
index 9950e5f4cc..4154ea0afb 100644
--- a/test/Transforms/InstCombine/objsize.ll
+++ b/test/Transforms/InstCombine/objsize.ll
@@ -176,3 +176,14 @@ define i32 @test9(i32 %x) {
; CHECK-NOT: ret i32 %x
ret i32 %objsize
}
+
+define i8* @test10(i32 %x) {
+; CHECK: @test10
+ %alloc = call noalias i8* @malloc(i32 %x) nounwind
+ %objsize = call i32 @llvm.objectsize.i32(i8* %alloc, i1 false) nounwind readonly
+ tail call i8* @__memset_chk(i8* %alloc, i32 0, i32 %x, i32 %objsize) nounwind
+; CHECK-NOT: @llvm.objectsize
+; CHECK: @llvm.memset
+ ret i8* %alloc
+; CHECK: ret i8*
+}