lowerinvoke.ll 668 B

12345678910111213141516171819202122232425
  1. ; RUN: opt < %s -lowerinvoke -S | FileCheck %s
  2. declare i32 @external_func(i64 %arg)
  3. define i32 @invoke_test(i64 %arg) personality i8* null {
  4. entry:
  5. %result = invoke fastcc i32 @external_func(i64 inreg %arg)
  6. to label %cont unwind label %lpad
  7. cont:
  8. ret i32 %result
  9. lpad:
  10. %phi = phi i32 [ 99, %entry ]
  11. %lp = landingpad { i8*, i32 } cleanup
  12. ret i32 %phi
  13. }
  14. ; The "invoke" should be converted to a "call".
  15. ; CHECK-LABEL: define i32 @invoke_test
  16. ; CHECK: %result = call fastcc i32 @external_func(i64 inreg %arg)
  17. ; CHECK-NEXT: br label %cont
  18. ; Note that this pass does not remove dead landingpad blocks.
  19. ; CHECK: lpad:
  20. ; CHECK-NOT: phi
  21. ; CHECK: landingpad