diff options
author | Florian Hahn <flo@fhahn.com> | 2022-01-11 13:43:53 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2022-01-11 13:43:53 +0000 |
commit | 50c3bf234f8dfda90fb4a9bda945f45638839ca2 (patch) | |
tree | 110e19cc52761dc02ab2151c940e5bf145ecb982 | |
parent | 88fdce5be696c7ef992cffce9da9ec6895a1abfc (diff) | |
download | llvm-50c3bf234f8dfda90fb4a9bda945f45638839ca2.tar.gz |
[InstSimplify] Add additional GEP tests with undef bases.
-rw-r--r-- | llvm/test/Transforms/InstSimplify/gep.ll | 18 |
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 |