llvm-6502/test/Transforms/InstCombine/cast-load-gep.ll
Dan Gohman b1e1e82c54 Change these tests to feed the assembly files to opt directly, instead
of using llvm-as, now that opt supports this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 16:50:01 +00:00

21 lines
659 B
LLVM

; RUN: opt %s -instcombine -globaldce | llvm-dis | \
; RUN: not grep Array
; Pulling the cast out of the load allows us to eliminate the load, and then
; the whole array.
%op = type { float }
%unop = type { i32 }
@Array = internal constant [1 x %op* (%op*)*] [ %op* (%op*)* @foo ] ; <[1 x %op* (%op*)*]*> [#uses=1]
define %op* @foo(%op* %X) {
ret %op* %X
}
define %unop* @caller(%op* %O) {
%tmp = load %unop* (%op*)** bitcast ([1 x %op* (%op*)*]* @Array to %unop* (%op*)**); <%unop* (%op*)*> [#uses=1]
%tmp.2 = call %unop* %tmp( %op* %O ) ; <%unop*> [#uses=1]
ret %unop* %tmp.2
}