inline_dce.ll 600 B

12345678910111213141516171819202122232425
  1. ; This checks to ensure that the inline pass deletes functions if they get
  2. ; inlined into all of their callers.
  3. ; RUN: opt < %s -inline -S | \
  4. ; RUN: not grep @reallysmall
  5. define internal i32 @reallysmall(i32 %A) {
  6. ret i32 %A
  7. }
  8. define void @caller1() {
  9. call i32 @reallysmall( i32 5 ) ; <i32>:1 [#uses=0]
  10. ret void
  11. }
  12. define void @caller2(i32 %A) {
  13. call i32 @reallysmall( i32 %A ) ; <i32>:1 [#uses=0]
  14. ret void
  15. }
  16. define i32 @caller3(i32 %A) {
  17. %B = call i32 @reallysmall( i32 %A ) ; <i32> [#uses=1]
  18. ret i32 %B
  19. }