Xamarin Public Jenkins (auto-signing) 64ac736ec5 Imported Upstream version 6.0.0.172
Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
2019-04-12 14:10:50 +00:00

21 lines
795 B
LLVM

; RUN: llc -march=mips -mcpu=mips32r2 < %s -o /dev/null
; Test that SelectionDAG does not crash during DAGCombine when two pointers
; to the stack match with differing bases and offsets when expanding memcpy.
; This could result in one of the pointers being considered dereferenceable
; and other not.
define void @foo(i8*) {
start:
%a = alloca [22 x i8]
%b = alloca [22 x i8]
%c = bitcast [22 x i8]* %a to i8*
%d = getelementptr inbounds [22 x i8], [22 x i8]* %b, i32 0, i32 2
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %c, i8* %d, i32 20, i32 1, i1 false)
%e = getelementptr inbounds [22 x i8], [22 x i8]* %b, i32 0, i32 6
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* %e, i32 12, i32 1, i1 false)
ret void
}
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)