summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/getelementptr.ll
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-01-23 17:52:29 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-01-23 17:52:29 +0000
commit028dba376ae90c82b44d72ddb3ed97849484aab4 (patch)
tree246dadac34a931c70c8df74e41171d9f5aeff88f /test/Transforms/InstCombine/getelementptr.ll
parent9381dd1ac9ac8a4020cd0dd03323a26f1ae5587f (diff)
downloadllvm-028dba376ae90c82b44d72ddb3ed97849484aab4.tar.gz
llvm-028dba376ae90c82b44d72ddb3ed97849484aab4.tar.bz2
llvm-028dba376ae90c82b44d72ddb3ed97849484aab4.tar.xz
Revert "InstCombine: Clean up weird code that talks about a modulus that's long gone."
This causes crashes during the build of compiler-rt during selfhost. Add a testcase for coverage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/getelementptr.ll')
-rw-r--r--test/Transforms/InstCombine/getelementptr.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/getelementptr.ll b/test/Transforms/InstCombine/getelementptr.ll
index 1c120ecbe9..03e26eb67e 100644
--- a/test/Transforms/InstCombine/getelementptr.ll
+++ b/test/Transforms/InstCombine/getelementptr.ll
@@ -492,3 +492,19 @@ define void @three_gep_f(%three_gep_t2* %x) {
declare void @three_gep_g(i32*)
declare void @three_gep_h(%three_gep_t2*)
+
+%struct.ham = type { i32, %struct.zot*, %struct.zot*, %struct.zot* }
+%struct.zot = type { i64, i8 }
+
+define void @test39(%struct.ham* %arg, i8 %arg1) nounwind {
+ %tmp = getelementptr inbounds %struct.ham* %arg, i64 0, i32 2
+ %tmp2 = load %struct.zot** %tmp, align 8
+ %tmp3 = bitcast %struct.zot* %tmp2 to i8*
+ %tmp4 = getelementptr inbounds i8* %tmp3, i64 -8
+ store i8 %arg1, i8* %tmp4, align 8
+ ret void
+
+; CHECK: @test39
+; CHECK: getelementptr inbounds %struct.ham* %arg, i64 0, i32 2
+; CHECK: getelementptr inbounds i8* %tmp3, i64 -8
+}