7a2202598482c97eb31619dfee250538e60cdf0e
[oota-llvm.git] / test / Transforms / GlobalDCE / 2002-08-17-FunctionDGE.ll
1 ; Make sure that functions are removed successfully if they are referred to by
2 ; a global that is dead.  Make sure any globals they refer to die as well.
3
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -globaldce | llvm-dis | not grep foo
5 ; XFAIL: *
6
7 %b = internal global int ()* %foo   ;; Unused, kills %foo
8
9 %foo = internal global int 7         ;; Should die when function %foo is killed
10
11 implementation
12
13 internal int %foo() {               ;; dies when %b dies.
14         %ret = load int* %foo
15         ret int %ret
16 }
17