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. llvm-svn: 11701
This commit is contained in:
parent
87d72eb23f
commit
9c08d09de6
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep '%c' | not grep cast
|
; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | grep '%c' | not grep cast
|
||||||
|
|
||||||
|
%inbuf = external global [32832 x ubyte]
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
int %test1(int %A) {
|
int %test1(int %A) {
|
||||||
|
@ -79,3 +81,9 @@ int* %test12() {
|
||||||
%c = cast [4 x sbyte]* %p to int*
|
%c = cast [4 x sbyte]* %p to int*
|
||||||
ret int* %c
|
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
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue