Relax dwarf line fragments. This fixes a crash in the included testcase.
[oota-llvm.git] / test / CodeGen / Generic / 2003-05-30-BadFoldGEP.ll
index 61d802cb84bdf2b961d571430b0ba2df30371482..10d3a11a5190d811b4a1ae848edd1b410c460add 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade %s | llvm-as | llc
+; RUN: llc < %s
 
 ;; Date:     May 28, 2003.
 ;; From:     test/Programs/External/SPEC/CINT2000/254.gap.llvm.bc
 ;;          The next instruction contributes a leading non-zero so another
 ;;          zero should not be added before it!
 ;;
+        %FileType = type { i32, [256 x i8], i32, i32, i32, i32 }
+@OutputFiles = external global [16 x %FileType]         ; <[16 x %FileType]*> [#uses=1]
+@Output = internal global %FileType* null               ; <%FileType**> [#uses=1]
 
-
-%FileType = type { int, [256 x sbyte], int, int, int, int }
-%OutputFiles = uninitialized global [16 x %FileType]
-%Output = internal global %FileType* null
-
-
-implementation; Functions:
-
-internal int %OpenOutput(sbyte* %filename.1) {
+define internal i32 @OpenOutput(i8* %filename.1) {
 entry:
-       %tmp.0 = load %FileType** %Output      
-        %tmp.4 = getelementptr %FileType* %tmp.0, long 1
-
-       ;;------ 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.
-        %addrOfGlobal = getelementptr [16 x %FileType]* %OutputFiles, long 0
-        %constantGEP = getelementptr [16 x %FileType]* %addrOfGlobal, long 1
-        %constantGEP = getelementptr [16 x %FileType]* %constantGEP, long 0, long 0
-       %tmp.10 = seteq %FileType* %tmp.4, %constantGEP
-        br bool %tmp.10, label %return, label %endif.0
-
-endif.0:
-       ret int 0
-
-return:
-       ret int 1
+        %tmp.0 = load %FileType** @Output               ; <%FileType*> [#uses=1]
+        %tmp.4 = getelementptr %FileType* %tmp.0, i64 1         ; <%FileType*> [#uses=1]
+        %addrOfGlobal = getelementptr [16 x %FileType]* @OutputFiles, i64 0             ; <[16 x %FileType]*> [#uses=1]
+        %constantGEP = getelementptr [16 x %FileType]* %addrOfGlobal, i64 1             ; <[16 x %FileType]*> [#uses=1]
+        %constantGEP.upgrd.1 = getelementptr [16 x %FileType]* %constantGEP, i64 0, i64 0               ; <%FileType*> [#uses=1]
+        %tmp.10 = icmp eq %FileType* %tmp.4, %constantGEP.upgrd.1               ; <i1> [#uses=1]
+        br i1 %tmp.10, label %return, label %endif.0
+
+endif.0:                ; preds = %entry
+        ret i32 0
+
+return:         ; preds = %entry
+        ret i32 1
 }
+