seh-nounwind.ll 840 B

1234567891011121314151617181920212223242526272829303132
  1. ; RUN: opt -S -O2 < %s | FileCheck %s
  2. ; Feature test that verifies that all optimizations leave asynch personality
  3. ; invokes of nounwind functions alone.
  4. ; The @div function in this test can fault, even though it can't
  5. ; throw a synchronous exception.
  6. define i32 @div(i32 %n, i32 %d) nounwind noinline {
  7. entry:
  8. %div = sdiv i32 %n, %d
  9. ret i32 %div
  10. }
  11. define i32 @main() nounwind personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
  12. entry:
  13. %call = invoke i32 @div(i32 10, i32 0)
  14. to label %__try.cont unwind label %lpad
  15. lpad:
  16. %0 = landingpad { i8*, i32 }
  17. catch i8* null
  18. br label %__try.cont
  19. __try.cont:
  20. %retval.0 = phi i32 [ %call, %entry ], [ 0, %lpad ]
  21. ret i32 %retval.0
  22. }
  23. ; CHECK-LABEL: define i32 @main()
  24. ; CHECK: invoke i32 @div(i32 10, i32 0)
  25. declare i32 @__C_specific_handler(...)