invoke_test-1.ll 690 B

12345678910111213141516171819202122232425262728
  1. ; Test that we can inline a simple function, turning the calls in it into invoke
  2. ; instructions
  3. ; RUN: opt < %s -inline -S | \
  4. ; RUN: not grep "call[^e]"
  5. declare void @might_throw()
  6. define internal void @callee() {
  7. call void @might_throw( )
  8. ret void
  9. }
  10. ; caller returns true if might_throw throws an exception...
  11. define i32 @caller() personality i32 (...)* @__gxx_personality_v0 {
  12. invoke void @callee( )
  13. to label %cont unwind label %exc
  14. cont: ; preds = %0
  15. ret i32 0
  16. exc: ; preds = %0
  17. %exn = landingpad {i8*, i32}
  18. cleanup
  19. ret i32 1
  20. }
  21. declare i32 @__gxx_personality_v0(...)