;; Error: A sequence of GEPs is folded incorrectly by llc during selection
;; causing an assertion about a dynamic casting error.
;; This code sequence was produced (correctly) by preselection
;; from a nested pair of ConstantExpr getelementptrs.
;; The code below is the output of preselection.
;; The original ConstantExprs are included in a comment.
;;
;; Cause: FoldGetElemChain() was inserting an extra leading 0 even though
;; the first instruction in the sequence contributes no indices.
;; The next instruction contributes a leading non-zero so another
;; zero should not be added before it!
;;
%FileType=type{int,[256xsbyte],int,int,int,int}
%OutputFiles=uninitializedglobal[16x%FileType]
%Output=internalglobal%FileType*null
implementation; Functions:
internalint%OpenOutput(sbyte*%filename.1){
entry:
%tmp.0=load%FileType**%Output
%tmp.4=getelementptr%FileType*%tmp.0,long1
;;------ Original instruction in 254.gap.llvm.bc:
;; %tmp.10 = seteq { int, [256 x sbyte], int, int, int, int }* %tmp.4, getelementptr ([16 x { int, [256 x sbyte], int, int, int, int }]* getelementptr ([16 x { int, [256 x sbyte], int, int, int, int }]* %OutputFiles, long 1), long 0, long 0)
;;------ Code sequence produced by preselection phase for above instr:
;; This code sequence is folded incorrectly by llc during selection
;; causing an assertion about a dynamic casting error.