aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-22 05:24:09 +0000
committerChris Lattner <sabre@nondot.org>2004-02-22 05:24:09 +0000
commit0ca4418b955f4497eea7f573164aa0afff629902 (patch)
tree3136e53a73226d875159877966689363b984c7ba
parent6d2fdcfb8a922570d3a60540d36eb7804e7296f2 (diff)
downloadexternal_llvm-0ca4418b955f4497eea7f573164aa0afff629902.zip
external_llvm-0ca4418b955f4497eea7f573164aa0afff629902.tar.gz
external_llvm-0ca4418b955f4497eea7f573164aa0afff629902.tar.bz2
Test that the instruction combiner can fold away a cast in a GEP instruction.
This occurs in 164.gzip, as a result of it declaring arrays extern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11701 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/InstCombine/cast.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll
index 11d95ca..53e2c2e 100644
--- a/test/Transforms/InstCombine/cast.ll
+++ b/test/Transforms/InstCombine/cast.ll
@@ -2,6 +2,8 @@
; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep '%c' | not grep cast
+%inbuf = external global [32832 x ubyte]
+
implementation
int %test1(int %A) {
@@ -79,3 +81,9 @@ int* %test12() {
%c = cast [4 x sbyte]* %p to int*
ret int* %c
}
+
+
+ubyte *%test13(long %A) {
+ %c = getelementptr [0 x ubyte]* cast ([32832 x ubyte]* %inbuf to [0 x ubyte]*), long 0, long %A
+ ret ubyte* %c
+}