summaryrefslogtreecommitdiff
path: root/test/Transforms/SROA/basictest.ll
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-09-18 22:37:19 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-09-18 22:37:19 +0000
commit38f35fd3b74ab608362bb871fc84481f54624e17 (patch)
treeba6497fbf3c232c744b91d38d997555e1abe00e5 /test/Transforms/SROA/basictest.ll
parenta177a511085211807ca7f22dbb801276f515c9d4 (diff)
downloadllvm-38f35fd3b74ab608362bb871fc84481f54624e17.tar.gz
llvm-38f35fd3b74ab608362bb871fc84481f54624e17.tar.bz2
llvm-38f35fd3b74ab608362bb871fc84481f54624e17.tar.xz
Fix the last crasher I've gotten a reproduction for in SROA. This one
from the dragonegg build bots when we turned on the full version of the pass. Included a much reduced test case for this pesky bug, despite bugpoint's uncooperative behavior. Also, I audited all the similar code I could find and didn't spot any other cases where this mistake cropped up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SROA/basictest.ll')
-rw-r--r--test/Transforms/SROA/basictest.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/SROA/basictest.ll b/test/Transforms/SROA/basictest.ll
index 49921aa587..82c524deba 100644
--- a/test/Transforms/SROA/basictest.ll
+++ b/test/Transforms/SROA/basictest.ll
@@ -754,3 +754,23 @@ entry:
ret void
}
+%opaque = type opaque
+
+define i32 @test19(%opaque* %x) {
+; This input will cause us to try to compute a natural GEP when rewriting
+; pointers in such a way that we try to GEP through the opaque type. Previously,
+; a check for an unsized type was missing and this crashed. Ensure it behaves
+; reasonably now.
+; CHECK: @test19
+; CHECK-NOT: alloca
+; CHECK: ret i32 undef
+
+entry:
+ %a = alloca { i64, i8* }
+ %cast1 = bitcast %opaque* %x to i8*
+ %cast2 = bitcast { i64, i8* }* %a to i8*
+ call void @llvm.memcpy.p0i8.p0i8.i32(i8* %cast2, i8* %cast1, i32 16, i32 1, i1 false)
+ %gep = getelementptr inbounds { i64, i8* }* %a, i32 0, i32 0
+ %val = load i64* %gep
+ ret i32 undef
+}