2002-08-17-FunctionDGE.ll 553 B

1234567891011121314151617
  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. ; RUN: opt < %s -globaldce -S | not grep foo
  4. ;; Unused, kills %foo
  5. @b = internal global i32 ()* @foo ; <i32 ()**> [#uses=0]
  6. ;; Should die when function %foo is killed
  7. @foo.upgrd.1 = internal global i32 7 ; <i32*> [#uses=1]
  8. ;; dies when %b dies.
  9. define internal i32 @foo() {
  10. %ret = load i32, i32* @foo.upgrd.1 ; <i32> [#uses=1]
  11. ret i32 %ret
  12. }