summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llvm/test/Transforms/InstSimplify/gep.ll18
1 files changed, 16 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstSimplify/gep.ll b/llvm/test/Transforms/InstSimplify/gep.ll
index 88dea412d131..4814291ddd67 100644
--- a/llvm/test/Transforms/InstSimplify/gep.ll
+++ b/llvm/test/Transforms/InstSimplify/gep.ll
@@ -158,6 +158,22 @@ define i8* @test7(i8* %b, i8** %e) {
ret i8* %gep
}
+define i64* @undef_inbounds_var_idx(i64 %idx) {
+; CHECK-LABEL: @undef_inbounds_var_idx(
+; CHECK-NEXT: ret i64* undef
+;
+ %el = getelementptr inbounds i64, i64* undef, i64 %idx
+ ret i64* %el
+}
+
+define i64* @undef_no_inbounds_var_idx(i64 %idx) {
+; CHECK-LABEL: @undef_no_inbounds_var_idx(
+; CHECK-NEXT: ret i64* undef
+;
+ %el = getelementptr i64, i64* undef, i64 %idx
+ ret i64* %el
+}
+
define <8 x i64*> @undef_vec1() {
; CHECK-LABEL: @undef_vec1(
; CHECK-NEXT: ret <8 x i64*> undef
@@ -257,8 +273,6 @@ define <vscale x 2 x i64*> @ptr_idx_mix_scalar_scalable_vector() {
; Check ConstantExpr::getGetElementPtr() using ElementCount for size queries - end.
-; TODO: these should return poison
-
define i8* @poison() {
; CHECK-LABEL: @poison(
; CHECK-NEXT: ret i8* poison