setjmp.ll 547 B

1234567891011121314151617181920212223242526272829
  1. ; RUN: opt < %s -tailcallelim -S | FileCheck %s
  2. ; Test that we don't tail call in a functions that calls returns_twice
  3. ; functions.
  4. declare void @bar()
  5. ; CHECK: foo1
  6. ; CHECK-NOT: tail call void @bar()
  7. define void @foo1(i32* %x) {
  8. bb:
  9. %tmp75 = tail call i32 @setjmp(i32* %x)
  10. call void @bar()
  11. ret void
  12. }
  13. declare i32 @setjmp(i32*) returns_twice
  14. ; CHECK: foo2
  15. ; CHECK-NOT: tail call void @bar()
  16. define void @foo2(i32* %x) {
  17. bb:
  18. %tmp75 = tail call i32 @zed2(i32* %x)
  19. call void @bar()
  20. ret void
  21. }
  22. declare i32 @zed2(i32*) returns_twice