aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/memcpy_chk-1.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/memcpy_chk-1.ll')
-rw-r--r--test/Transforms/InstCombine/memcpy_chk-1.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/memcpy_chk-1.ll b/test/Transforms/InstCombine/memcpy_chk-1.ll
index 9216ae7fe95a..008b838201ed 100644
--- a/test/Transforms/InstCombine/memcpy_chk-1.ll
+++ b/test/Transforms/InstCombine/memcpy_chk-1.ll
@@ -57,4 +57,17 @@ define void @test_no_simplify2() {
ret void
}
+define i8* @test_simplify_return_indcall(i8* ()* %alloc) {
+; CHECK-LABEL: @test_simplify_return_indcall(
+ %src = bitcast %struct.T2* @t2 to i8*
+
+; CHECK-NEXT: %dst = call i8* %alloc()
+ %dst = call i8* %alloc()
+
+; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64
+ %ret = call i8* @__memcpy_chk(i8* %dst, i8* %src, i64 1824, i64 1824)
+; CHECK-NEXT: ret i8* %dst
+ ret i8* %ret
+}
+
declare i8* @__memcpy_chk(i8*, i8*, i64, i64)