deadglobal.ll 468 B

12345678910111213141516171819202122232425
  1. ; RUN: opt < %s -globalopt -S | FileCheck %s
  2. @G1 = internal global i32 123 ; <i32*> [#uses=1]
  3. ; CHECK-NOT: @G1
  4. ; CHECK: @G2
  5. ; CHECK-NOT: @G3
  6. define void @foo1() {
  7. ; CHECK: define void @foo
  8. ; CHECK-NEXT: ret
  9. store i32 1, i32* @G1
  10. ret void
  11. }
  12. @G2 = linkonce_odr constant i32 42
  13. define void @foo2() {
  14. ; CHECK-LABEL: define void @foo2(
  15. ; CHECK-NEXT: store
  16. store i32 1, i32* @G2
  17. ret void
  18. }
  19. @G3 = linkonce_odr constant i32 42