Simon Dardis | 5129659 | 2017-08-03 09:38:46 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=mips -mcpu=mips32r2 < %s -o /dev/null |
| 2 | |
| 3 | ; Test that SelectionDAG does not crash during DAGCombine when two pointers |
| 4 | ; to the stack match with differing bases and offsets when expanding memcpy. |
| 5 | ; This could result in one of the pointers being considered dereferenceable |
| 6 | ; and other not. |
| 7 | |
| 8 | define void @foo(i8*) { |
| 9 | start: |
| 10 | %a = alloca [22 x i8] |
| 11 | %b = alloca [22 x i8] |
| 12 | %c = bitcast [22 x i8]* %a to i8* |
| 13 | %d = getelementptr inbounds [22 x i8], [22 x i8]* %b, i32 0, i32 2 |
Daniel Neilson | 1e68724 | 2018-01-19 17:13:12 +0000 | [diff] [blame] | 14 | call void @llvm.memcpy.p0i8.p0i8.i32(i8* %c, i8* %d, i32 20, i1 false) |
Simon Dardis | 5129659 | 2017-08-03 09:38:46 +0000 | [diff] [blame] | 15 | %e = getelementptr inbounds [22 x i8], [22 x i8]* %b, i32 0, i32 6 |
Daniel Neilson | 1e68724 | 2018-01-19 17:13:12 +0000 | [diff] [blame] | 16 | call void @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* %e, i32 12, i1 false) |
Simon Dardis | 5129659 | 2017-08-03 09:38:46 +0000 | [diff] [blame] | 17 | ret void |
| 18 | } |
| 19 | |
Daniel Neilson | 1e68724 | 2018-01-19 17:13:12 +0000 | [diff] [blame] | 20 | declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1) |