aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-09 05:44:56 +0000
committerChris Lattner <sabre@nondot.org>2009-01-09 05:44:56 +0000
commit46cd5a13e575d7f7152d822f3af148fa8e66614d (patch)
tree3271ce63babf7afb3364d0b1c281cd7646289136 /test
parenta545778a77359110dfb6c5d24df82321d7405d71 (diff)
Fix part 3/2 of PR3290, making instcombine zap (gep(bitcast)) when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61980 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/bitcast-gep.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/bitcast-gep.ll b/test/Transforms/InstCombine/bitcast-gep.ll
index 5a514ab5c6..2e1f7693fc 100644
--- a/test/Transforms/InstCombine/bitcast-gep.ll
+++ b/test/Transforms/InstCombine/bitcast-gep.ll
@@ -17,3 +17,14 @@ define i8* @test(i8* %v) {
%G = load i8** %F ; <i8*> [#uses=1]
ret i8* %G
}
+
+; PR3290
+%struct.Key = type { { i32, i32 } }
+%struct.anon = type <{ i8, [3 x i8], i32 }>
+
+define i32 *@test2(%struct.Key *%A) {
+ %B = bitcast %struct.Key* %A to %struct.anon*
+ %C = getelementptr %struct.anon* %B, i32 0, i32 2
+ ret i32 *%C
+}
+