[InstSimplify] add a test for gep with poison operand (NFC)

This commit is contained in:
Juneyoung Lee 2021-01-05 11:03:11 +09:00
parent c4f12a07a4
commit f28b026d32
1 changed files with 10 additions and 1 deletions

View File

@ -218,7 +218,7 @@ define <vscale x 2 x i64*> @ptr_idx_mix_scalar_scalable_vector() {
; Check ConstantExpr::getGetElementPtr() using ElementCount for size queries - end.
; TODO: this should return poison
; TODO: these should return poison
define i8* @poison() {
; CHECK-LABEL: @poison(
@ -227,3 +227,12 @@ define i8* @poison() {
%v = getelementptr i8, i8* poison, i64 1
ret i8* %v
}
define i8* @poison2(i8* %baseptr) {
; CHECK-LABEL: @poison2(
; CHECK-NEXT: [[V:%.*]] = getelementptr i8, i8* [[BASEPTR:%.*]], i64 poison
; CHECK-NEXT: ret i8* [[V]]
;
%v = getelementptr i8, i8* %baseptr, i64 poison
ret i8* %v
}