aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/GlobalDCE
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2008-03-01 09:15:35 +0000
committerTanya Lattner <tonic@nondot.org>2008-03-01 09:15:35 +0000
commitec9a35a6f9143cfa325e0413cc297c48f627973a (patch)
treec1b0621415acc20f94152c51174d53fae3dbc8cc /test/Transforms/GlobalDCE
parentab3b77834c9232e4c13acb29afe1920b97c5a20b (diff)
Remove llvm-upgrade and update test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GlobalDCE')
-rw-r--r--test/Transforms/GlobalDCE/2002-07-17-CastRef.ll15
-rw-r--r--test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll15
-rw-r--r--test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll17
-rw-r--r--test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll18
-rw-r--r--test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll16
-rw-r--r--test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll14
-rw-r--r--test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll4
-rw-r--r--test/Transforms/GlobalDCE/basicvariabletest.ll6
8 files changed, 51 insertions, 54 deletions
diff --git a/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll b/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll
index 3679d51611..a79f6738f1 100644
--- a/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll
+++ b/test/Transforms/GlobalDCE/2002-07-17-CastRef.ll
@@ -1,12 +1,11 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -globaldce
+; RUN: llvm-as < %s | opt -globaldce
;
-implementation
-
-internal void %func() { ; Not dead, can be reachable via X
- ret void
+define internal void @func() {
+ ret void
}
-void %main() {
- %X = cast void()* %func to int*
- ret void
+define void @main() {
+ %X = bitcast void ()* @func to i32* ; <i32*> [#uses=0]
+ ret void
}
+
diff --git a/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll b/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll
index 8bb6da55b9..2a398468be 100644
--- a/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll
+++ b/test/Transforms/GlobalDCE/2002-07-17-ConstantRef.ll
@@ -1,12 +1,13 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -globaldce
+; RUN: llvm-as < %s | opt -globaldce
;
-%X = global void() * %func
-implementation
-internal void %func() { ; Not dead, can be reachable via X
- ret void
+@X = global void ()* @func ; <void ()**> [#uses=0]
+
+; Not dead, can be reachable via X
+define internal void @func() {
+ ret void
}
-void %main() {
- ret void
+define void @main() {
+ ret void
}
diff --git a/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll b/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
index e0af3c2c48..dac81a3999 100644
--- a/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
+++ b/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
@@ -1,16 +1,17 @@
; Make sure that functions are removed successfully if they are referred to by
; a global that is dead. Make sure any globals they refer to die as well.
-; RUN: llvm-upgrade < %s | llvm-as | opt -globaldce | llvm-dis | not grep foo
+; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep foo
-%b = internal global int ()* %foo ;; Unused, kills %foo
+;; Unused, kills %foo
+@b = internal global i32 ()* @foo ; <i32 ()**> [#uses=0]
-%foo = internal global int 7 ;; Should die when function %foo is killed
+;; Should die when function %foo is killed
+@foo.upgrd.1 = internal global i32 7 ; <i32*> [#uses=1]
-implementation
-
-internal int %foo() { ;; dies when %b dies.
- %ret = load int* %foo
- ret int %ret
+ ;; dies when %b dies.
+define internal i32 @foo() {
+ %ret = load i32* @foo.upgrd.1 ; <i32> [#uses=1]
+ ret i32 %ret
}
diff --git a/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll b/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll
index 493e30c309..d07f0140c4 100644
--- a/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll
+++ b/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll
@@ -1,14 +1,12 @@
; This testcase tests that a worklist is being used, and that globals can be
; removed if they are the subject of a constexpr and ConstantPointerRef
-; RUN: llvm-upgrade < %s | llvm-as | opt -globaldce | llvm-dis | not grep global
-
-%t0 = internal global [4 x sbyte] c"foo\00"
-%t1 = internal global [4 x sbyte] c"bar\00"
-
-%s1 = internal global [1 x sbyte*] [sbyte* cast ([4 x sbyte]* %t0 to sbyte*)]
-%s2 = internal global [1 x sbyte*] [sbyte* getelementptr ([4 x sbyte]* %t1, uint 0, uint 0 )]
-
-%b = internal global int* %a
-%a = internal global int 7
+; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep global
+
+@t0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1]
+@t1 = internal global [4 x i8] c"bar\00" ; <[4 x i8]*> [#uses=1]
+@s1 = internal global [1 x i8*] [ i8* getelementptr ([4 x i8]* @t0, i32 0, i32 0) ] ; <[1 x i8*]*> [#uses=0]
+@s2 = internal global [1 x i8*] [ i8* getelementptr ([4 x i8]* @t1, i64 0, i64 0) ] ; <[1 x i8*]*> [#uses=0]
+@b = internal global i32* @a ; <i32**> [#uses=0]
+@a = internal global i32 7 ; <i32*> [#uses=1]
diff --git a/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll b/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll
index bc650d2e89..b49bfcc494 100644
--- a/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll
+++ b/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll
@@ -1,13 +1,11 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -globaldce
+; RUN: llvm-as < %s | opt -globaldce
-%foo = internal global int 7 ;; Should die when function %foo is killed
+;; Should die when function %foo is killed
+@foo.upgrd.1 = internal global i32 7 ; <i32*> [#uses=3]
+@bar = internal global [2 x { i32*, i32 }] [ { i32*, i32 } { i32* @foo.upgrd.1, i32 7 }, { i32*, i32 } { i32* @foo.upgrd.1, i32 1 } ] ; <[2 x { i32*, i32 }]*> [#uses=0]
-%bar = internal global [2x { int *, int }] [ { int *, int } { int* %foo, int 7}, {int*, int} { int* %foo, int 1 }]
-
-implementation
-
-internal int %foo() { ;; dies when %b dies.
- %ret = load int* %foo
- ret int %ret
+define internal i32 @foo() {
+ %ret = load i32* @foo.upgrd.1 ; <i32> [#uses=1]
+ ret i32 %ret
}
diff --git a/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll b/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll
index afdc1cd12d..c6c51df94c 100644
--- a/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll
+++ b/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll
@@ -1,11 +1,11 @@
; distilled from 255.vortex
-; RUN: llvm-upgrade < %s | llvm-as | opt -globaldce | llvm-dis | not grep testfunc
+; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep testfunc
-implementation
+declare i1 ()* @getfunc()
-declare bool()* %getfunc()
-internal bool %testfunc() {
- %F = call bool()*()* %getfunc()
- %c = seteq bool()* %F, %testfunc
- ret bool %c
+define internal i1 @testfunc() {
+ %F = call i1 ()* ()* @getfunc( ) ; <i1 ()*> [#uses=1]
+ %c = icmp eq i1 ()* %F, @testfunc ; <i1> [#uses=1]
+ ret i1 %c
}
+
diff --git a/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll b/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll
index ff41163ce7..12d4736d27 100644
--- a/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll
+++ b/test/Transforms/GlobalDCE/2003-10-09-PreserveWeakGlobals.ll
@@ -1,6 +1,6 @@
; Weak variables should be preserved by global DCE!
-; RUN: llvm-upgrade < %s | llvm-as | opt -globaldce | llvm-dis | grep @A
+; RUN: llvm-as < %s | opt -globaldce | llvm-dis | grep @A
-%A = weak global int 54
+@A = weak global i32 54
diff --git a/test/Transforms/GlobalDCE/basicvariabletest.ll b/test/Transforms/GlobalDCE/basicvariabletest.ll
index 0b5c8b6fae..c883e58b84 100644
--- a/test/Transforms/GlobalDCE/basicvariabletest.ll
+++ b/test/Transforms/GlobalDCE/basicvariabletest.ll
@@ -1,5 +1,5 @@
-; RUN: llvm-upgrade < %s | llvm-as | opt -globaldce | llvm-dis | not grep global
+; RUN: llvm-as < %s | opt -globaldce | llvm-dis | not grep global
-%X = uninitialized global int
-%Y = internal global int 7
+@X = external global i32
+@Y = internal global i32 7