Remove the getAttributesAtIndex and getNumAttrs methods in favor of using the getAttr...
[oota-llvm.git] / test / Transforms / GlobalDCE / 2002-08-17-FunctionDGE.ll
index e0af3c2c487801f45a89f285732a27555eab9a76..766c227460e6d310c1626f99d82d00dd4d09af95 100644 (file)
@@ -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: opt < %s -globaldce -S | 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
 }