Skip to content

Commit 64233ae

Browse files
committed
[DSE] Add test with llvm.memcpy & memcpy_chk.
This adds test coverage to avoid crashes with further changes.
1 parent b134c62 commit 64233ae

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/test/Transforms/DeadStoreElimination/libcalls-chk.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,16 @@ define void @dse_strncpy_memcpy_chk_test2(ptr noalias %out, ptr noalias %in, i64
127127
%call.1 = tail call ptr @__memcpy_chk(ptr %out, ptr %in, i64 100, i64 %n)
128128
ret void
129129
}
130+
131+
define void @test_memcpy_intrinsic_and_memcpy_chk(ptr %A, ptr %B, ptr noalias %C) {
132+
; CHECK-LABEL: @test_memcpy_intrinsic_and_memcpy_chk(
133+
; CHECK-NEXT: tail call void @llvm.memcpy.p0.p0.i64(ptr [[A:%.*]], ptr [[B:%.*]], i64 48, i1 false)
134+
; CHECK-NEXT: [[CALL:%.*]] = call ptr @__memcpy_chk(ptr [[A]], ptr [[C:%.*]], i64 1, i64 10)
135+
; CHECK-NEXT: ret void
136+
;
137+
tail call void @llvm.memcpy.p0.p0.i64(ptr %A, ptr %B, i64 48, i1 false)
138+
%call = call ptr @__memcpy_chk(ptr %A, ptr %C, i64 1, i64 10)
139+
ret void
140+
}
141+
142+
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg)

0 commit comments

Comments
 (0)