statepoint-invoke-unwind.ll 948 B

123456789101112131415161718192021222324
  1. ; RUN: opt < %s -simplifycfg -S | FileCheck %s
  2. ; Test that statepoint intrinsic is marked with Throwable attribute and it is
  3. ; not optimized into call
  4. declare i64 addrspace(1)* @gc_call()
  5. declare i32 @llvm.experimental.gc.statepoint.p0f_p1i64f(i64, i32, i64 addrspace(1)* ()*, i32, i32, ...)
  6. declare i32* @fake_personality_function()
  7. define i32 @test() gc "statepoint-example" personality i32* ()* @fake_personality_function {
  8. ; CHECK-LABEL: test
  9. entry:
  10. ; CHECK-LABEL: entry:
  11. ; CHECK-NEXT: %sp = invoke i32 (i64, i32, i64 addrspace(1)* ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64f
  12. %sp = invoke i32 (i64, i32, i64 addrspace(1)* ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64f(i64 0, i32 0, i64 addrspace(1)* ()* @gc_call, i32 0, i32 0, i32 0, i32 0)
  13. to label %normal unwind label %exception
  14. exception:
  15. %lpad = landingpad { i8*, i32 }
  16. cleanup
  17. ret i32 0
  18. normal:
  19. ret i32 1
  20. }