From 2ad38be2cf53467d39c34456795360f122b37629 Mon Sep 17 00:00:00 2001
From: Tanya Lattner <tonic@nondot.org>
Date: Tue, 19 Feb 2008 01:44:26 +0000
Subject: [PATCH] Remove llvm-upgrade and update tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47297 91177308-0d34-0410-b5e6-96231b3b80d8
---
 test/Other/2002-01-31-CallGraph.ll            | 14 ++++----
 test/Other/2002-02-24-InlineBrokePHINodes.ll  | 35 +++++++++----------
 test/Other/2002-03-11-ConstPropCrash.ll       | 27 +++++++-------
 test/Other/2003-02-19-LoopInfoNestingBug.ll   | 33 ++++++++---------
 test/Other/2004-08-16-LowerPacked.ll          | 32 ++++++++---------
 .../2004-08-16-PackedConstantInlineStore.ll   | 15 ++++----
 test/Other/2004-08-16-PackedGlobalConstant.ll | 18 +++++-----
 test/Other/2004-08-16-PackedSelect.ll         | 22 ++++++------
 test/Other/2004-08-16-PackedSimple.ll         | 22 ++++++------
 test/Other/2004-08-20-PackedControlFlow.ll    | 33 +++++++++--------
 ...007-04-24-eliminate-mostly-empty-blocks.ll |  4 +--
 11 files changed, 118 insertions(+), 137 deletions(-)

diff --git a/test/Other/2002-01-31-CallGraph.ll b/test/Other/2002-01-31-CallGraph.ll
index 61c1277d642..e09461dc2ac 100644
--- a/test/Other/2002-01-31-CallGraph.ll
+++ b/test/Other/2002-01-31-CallGraph.ll
@@ -1,15 +1,13 @@
 ;  Call graph construction crash: Not handling indirect calls right
 ;
-; RUN: llvm-upgrade < %s | llvm-as | opt -analyze -callgraph
+; RUN: llvm-as < %s | opt -analyze -callgraph
 ;
 
-%FunTy = type int(int)
+        %FunTy = type i32 (i32)
 
-implementation
+define void @invoke(%FunTy* %x) {
+        %foo = call i32 %x( i32 123 )           ; <i32> [#uses=0]
+        ret void
+}
 
-void "invoke"(%FunTy *%x)
-begin
-	%foo = call %FunTy* %x(int 123)
-	ret void
-end
 
diff --git a/test/Other/2002-02-24-InlineBrokePHINodes.ll b/test/Other/2002-02-24-InlineBrokePHINodes.ll
index cb02ea486ed..cbb1a896937 100644
--- a/test/Other/2002-02-24-InlineBrokePHINodes.ll
+++ b/test/Other/2002-02-24-InlineBrokePHINodes.ll
@@ -1,26 +1,23 @@
-; Inlining used to break PHI nodes.  This tests that they are correctly updated 
+; Inlining used to break PHI nodes.  This tests that they are correctly updated
 ; when a node is split around the call instruction.  The verifier caught the error.
 ;
-; RUN: llvm-upgrade < %s | llvm-as | opt -inline
+; RUN: llvm-as < %s | opt -inline
 ;
-implementation
 
-ulong "test"(ulong %X)
-begin
-	ret ulong %X
-end
+define i64 @test(i64 %X) {
+	ret i64 %X
+}
 
-ulong "fib"(ulong %n)
-begin
-  %T = setlt ulong %n, 2       ; {bool}:0
-  br bool %T, label %BaseCase, label %RecurseCase
+define i64 @fib(i64 %n) {
+; <label>:0
+	%T = icmp ult i64 %n, 2		; <i1> [#uses=1]
+	br i1 %T, label %BaseCase, label %RecurseCase
 
-RecurseCase:
-  %result = call ulong %test(ulong %n)
-  br label %BaseCase
-
-BaseCase:
-  %X = phi ulong [1, %0], [2, %RecurseCase]
-  ret ulong %X
-end
+RecurseCase:		; preds = %0
+	%result = call i64 @test( i64 %n )		; <i64> [#uses=0]
+	br label %BaseCase
 
+BaseCase:		; preds = %RecurseCase, %0
+	%X = phi i64 [ 1, %0 ], [ 2, %RecurseCase ]		; <i64> [#uses=1]
+	ret i64 %X
+}
diff --git a/test/Other/2002-03-11-ConstPropCrash.ll b/test/Other/2002-03-11-ConstPropCrash.ll
index 91bea5324d8..90dc0026935 100644
--- a/test/Other/2002-03-11-ConstPropCrash.ll
+++ b/test/Other/2002-03-11-ConstPropCrash.ll
@@ -5,21 +5,20 @@
 ;
 ; Fixed by adding new arguments to ConstantFoldTerminator
 ;
-; RUN: llvm-upgrade < %s | llvm-as | opt -constprop
+; RUN: llvm-as < %s | opt -constprop
 
-implementation
+define void @build_tree(i32 %ml) {
+; <label>:0
+        br label %bb2
 
-void "build_tree"(int %ml)
-begin
-	br label %bb2
+bb2:            ; preds = %bb2, %0
+        %reg137 = phi i32 [ %reg140, %bb2 ], [ 12, %0 ]         ; <i32> [#uses=1]
+        %reg138 = phi i32 [ %reg139, %bb2 ], [ 0, %0 ]          ; <i32> [#uses=1]
+        %reg139 = add i32 %reg138, 1            ; <i32> [#uses=1]
+        %reg140 = add i32 %reg137, -1           ; <i32> [#uses=1]
+        br i1 false, label %bb2, label %bb3
 
-bb2:
-	%reg137 = phi int [ %reg140, %bb2 ], [ 12, %0 ]		; <int> [#uses=2]
-	%reg138 = phi uint [ %reg139, %bb2 ], [ 0, %0 ]		; <uint> [#uses=3]
-	%reg139 = add uint %reg138, 1		; <uint> [#uses=1]
-	%reg140 = add int %reg137, -1		; <int> [#uses=1]
-	br bool false, label %bb2, label %bb3
+bb3:            ; preds = %bb2
+        ret void
+}
 
-bb3:
-	ret void
-end
diff --git a/test/Other/2003-02-19-LoopInfoNestingBug.ll b/test/Other/2003-02-19-LoopInfoNestingBug.ll
index ebad6baa371..32390f49a20 100644
--- a/test/Other/2003-02-19-LoopInfoNestingBug.ll
+++ b/test/Other/2003-02-19-LoopInfoNestingBug.ll
@@ -2,27 +2,28 @@
 ; figure out that loop "Inner" should be nested inside of leep "LoopHeader", 
 ; and instead nests it just inside loop "Top"
 ;
-; RUN: llvm-upgrade < %s | llvm-as | opt -analyze -loops | \
+; RUN: llvm-as < %s | opt -analyze -loops | \
 ; RUN:   grep {     Loop Containing:\[ \]*%Inner}
 ;
+define void @test() {
+        br label %Top
 
-implementation
+Top:            ; preds = %Out, %0
+        br label %LoopHeader
 
-void %test() {
-	br label %Top
-Top:
-	br label %LoopHeader
-Next:
-	br bool false, label %Inner, label %Out
-Inner:
-	br bool false, label %Inner, label %LoopHeader
+Next:           ; preds = %LoopHeader
+        br i1 false, label %Inner, label %Out
 
-LoopHeader:
-	br label %Next
+Inner:          ; preds = %Inner, %Next
+        br i1 false, label %Inner, label %LoopHeader
 
-Out:
-	br bool false, label %Top, label %Done
+LoopHeader:             ; preds = %Inner, %Top
+        br label %Next
 
-Done:
-	ret void
+Out:            ; preds = %Next
+        br i1 false, label %Top, label %Done
+
+Done:           ; preds = %Out
+        ret void
 }
+
diff --git a/test/Other/2004-08-16-LowerPacked.ll b/test/Other/2004-08-16-LowerPacked.ll
index 910f89a6a8b..a3bc4c36085 100644
--- a/test/Other/2004-08-16-LowerPacked.ll
+++ b/test/Other/2004-08-16-LowerPacked.ll
@@ -1,20 +1,16 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -lower-packed | llvm-dis
+; RUN: llvm-as < %s | opt -lower-packed | llvm-dis
+@foo = external global <2 x i32>                ; <<2 x i32>*> [#uses=2]
+@bar = external global <2 x i32>                ; <<2 x i32>*> [#uses=1]
 
-%foo = uninitialized global <2 x int>;
-%bar = uninitialized global <2 x int>;
-
-implementation   ; Functions:
-
-void %main()
-{
-	%t0 = load <2 x int>* %foo
-	%t2 = add <2 x int> %t0, %t0
-	%t3 = select bool false, <2 x int> %t0, <2 x int> %t2
-	store <2 x int> %t3, <2 x int>* %bar
-          
-        %c0 = add <2 x int> <int 1, int 1>, %t0
-        %c1 = add <2 x int> %t0, <int 0, int 0>
-        %c2 = select bool true, <2 x int> <int 1, int 1>, <2 x int> %t0
-        store <2 x int> <int 4, int 4>, <2 x int>* %foo
-	ret void
+define void @main() {
+        %t0 = load <2 x i32>* @foo              ; <<2 x i32>> [#uses=6]
+        %t2 = add <2 x i32> %t0, %t0            ; <<2 x i32>> [#uses=1]
+        %t3 = select i1 false, <2 x i32> %t0, <2 x i32> %t2             ; <<2 x i32>> [#uses=1]
+        store <2 x i32> %t3, <2 x i32>* @bar
+        %c0 = add <2 x i32> < i32 1, i32 1 >, %t0               ; <<2 x i32>> [#uses=0]
+        %c1 = add <2 x i32> %t0, zeroinitializer                ; <<2 x i32>> [#uses=0]
+        %c2 = select i1 true, <2 x i32> < i32 1, i32 1 >, <2 x i32> %t0         ; <<2 x i32>> [#uses=0]
+        store <2 x i32> < i32 4, i32 4 >, <2 x i32>* @foo
+        ret void
 }
+
diff --git a/test/Other/2004-08-16-PackedConstantInlineStore.ll b/test/Other/2004-08-16-PackedConstantInlineStore.ll
index 6f94d9925db..36ac4fd5af4 100644
--- a/test/Other/2004-08-16-PackedConstantInlineStore.ll
+++ b/test/Other/2004-08-16-PackedConstantInlineStore.ll
@@ -1,11 +1,8 @@
-; RUN: llvm-upgrade < %s | llvm-as | llvm-dis
+; RUN: llvm-as < %s | llvm-dis
+@bar = external global <2 x i32>                ; <<2 x i32>*> [#uses=1]
 
-%bar = external global <2 x int>		; <<2 x int>*> [#uses=1]
-
-implementation   ; Functions:
-
-void %main() 
-{
-	store <2 x int> < int 0, int 1 >, <2 x int>* %bar
-	ret void
+define void @main() {
+        store <2 x i32> < i32 0, i32 1 >, <2 x i32>* @bar
+        ret void
 }
+
diff --git a/test/Other/2004-08-16-PackedGlobalConstant.ll b/test/Other/2004-08-16-PackedGlobalConstant.ll
index 638e862cc6f..9130ccba173 100644
--- a/test/Other/2004-08-16-PackedGlobalConstant.ll
+++ b/test/Other/2004-08-16-PackedGlobalConstant.ll
@@ -1,13 +1,11 @@
-; RUN: llvm-upgrade < %s | llvm-as | llvm-dis
+; RUN: llvm-as < %s | llvm-dis
 
-%foo = global <2 x int> <int 0, int 1>;
-%bar = uninitialized global <2 x int>;
+@foo = global <2 x i32> < i32 0, i32 1 >                ; <<2 x i32>*> [#uses=1]
+@bar = external global <2 x i32>                ; <<2 x i32>*> [#uses=1]
 
-implementation   ; Functions:
-
-void %main()
-{
-	%t0 = load <2 x int>* %foo;
-	store <2 x int> %t0, <2 x int>* %bar   
-	ret void
+define void @main() {
+        %t0 = load <2 x i32>* @foo              ; <<2 x i32>> [#uses=1]
+        store <2 x i32> %t0, <2 x i32>* @bar
+        ret void
 }
+
diff --git a/test/Other/2004-08-16-PackedSelect.ll b/test/Other/2004-08-16-PackedSelect.ll
index 4485543708f..64383169d29 100644
--- a/test/Other/2004-08-16-PackedSelect.ll
+++ b/test/Other/2004-08-16-PackedSelect.ll
@@ -1,15 +1,13 @@
-; RUN: llvm-upgrade < %s | llvm-as | llvm-dis
+; RUN: llvm-as < %s | llvm-dis
 
-%foo = uninitialized global <4 x float>;
-%bar = uninitialized global <4 x float>;
+@foo = external global <4 x float>              ; <<4 x float>*> [#uses=1]
+@bar = external global <4 x float>              ; <<4 x float>*> [#uses=1]
 
-implementation   ; Functions:
-
-void %main()
-{
-	%t0 = load <4 x float>* %foo
-	%t1 = add <4 x float> %t0, %t0
-        %t2 = select bool true, <4 x float> %t0, <4 x float> %t1
-	store <4 x float> %t2, <4 x float>* %bar  
-	ret void
+define void @main() {
+        %t0 = load <4 x float>* @foo            ; <<4 x float>> [#uses=3]
+        %t1 = add <4 x float> %t0, %t0          ; <<4 x float>> [#uses=1]
+        %t2 = select i1 true, <4 x float> %t0, <4 x float> %t1          ; <<4 x float>> [#uses=1]
+        store <4 x float> %t2, <4 x float>* @bar
+        ret void
 }
+
diff --git a/test/Other/2004-08-16-PackedSimple.ll b/test/Other/2004-08-16-PackedSimple.ll
index f50cd210a5d..5bb8b793000 100644
--- a/test/Other/2004-08-16-PackedSimple.ll
+++ b/test/Other/2004-08-16-PackedSimple.ll
@@ -1,15 +1,13 @@
-; RUN: llvm-upgrade < %s | llvm-as | llvm-dis
+; RUN: llvm-as < %s | llvm-dis
 
-%foo = uninitialized global <4 x float>;
-%bar = uninitialized global <4 x float>;
+@foo = external global <4 x float>              ; <<4 x float>*> [#uses=1]
+@bar = external global <4 x float>              ; <<4 x float>*> [#uses=1]
 
-implementation   ; Functions:
-
-void %main()
-{
-	%t0 = load <4 x float>* %foo
-	%t2 = add <4 x float> %t0, %t0
-	%t3 = select bool false, <4 x float> %t0, <4 x float> %t2
-	store <4 x float> %t3, <4 x float>* %bar  
-	ret void
+define void @main() {
+        %t0 = load <4 x float>* @foo            ; <<4 x float>> [#uses=3]
+        %t2 = add <4 x float> %t0, %t0          ; <<4 x float>> [#uses=1]
+        %t3 = select i1 false, <4 x float> %t0, <4 x float> %t2         ; <<4 x float>> [#uses=1]
+        store <4 x float> %t3, <4 x float>* @bar
+        ret void
 }
+
diff --git a/test/Other/2004-08-20-PackedControlFlow.ll b/test/Other/2004-08-20-PackedControlFlow.ll
index d2566b15638..49aa606adc0 100644
--- a/test/Other/2004-08-20-PackedControlFlow.ll
+++ b/test/Other/2004-08-20-PackedControlFlow.ll
@@ -1,23 +1,22 @@
-; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | llvm-as > /dev/null
+; RUN: llvm-as < %s | llvm-dis | llvm-as > /dev/null
 
-%v4f = type <4 x float>
+        %v4f = type <4 x float>
+@foo = external global %v4f             ; <%v4f*> [#uses=1]
+@bar = external global %v4f             ; <%v4f*> [#uses=1]
 
-%foo = uninitialized global %v4f
-%bar = uninitialized global %v4f
+define void @main() {
+        br label %A
 
-implementation   ; Functions:
+C:              ; preds = %B
+        store %v4f %t2, %v4f* @bar
+        ret void
 
-void %main() {
-	br label %A
-C:
-	store %v4f %t2, %v4f* %bar  
-	ret void
+B:              ; preds = %A
+        %t2 = add %v4f %t0, %t0         ; <%v4f> [#uses=1]
+        br label %C
 
-B:
-	%t2 = add %v4f %t0, %t0
-	br label %C
-
-A:
-	%t0 = load %v4f* %foo
-	br label %B
+A:              ; preds = %0
+        %t0 = load %v4f* @foo           ; <%v4f> [#uses=2]
+        br label %B
 }
+
diff --git a/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll b/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll
index 1bb86838388..4ffcf96b0ef 100644
--- a/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll
+++ b/test/Other/2007-04-24-eliminate-mostly-empty-blocks.ll
@@ -1,6 +1,6 @@
-;RUN: llvm-upgrade < %s | llvm-as | opt -codegenprepare -disable-output
+;RUN: llvm-as < %s | opt -codegenprepare -disable-output
 
-void @foo() {
+define void @foo() {
 entry:
 	br i1 false, label %cond_next31, label %cond_true