1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
5 declare i32 @personality_function()
7 define void @test_id() gc "statepoint-example" personality ptr @personality_function {
8 ; CHECK-LABEL: @test_id(
10 ; CHECK-NEXT: [[STATEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 100, i32 0, ptr elementtype(void ()) @f, i32 0, i32 0, i32 0, i32 0)
11 ; CHECK-NEXT: to label [[NORMAL_RETURN:%.*]] unwind label [[EXCEPTIONAL_RETURN:%.*]]
12 ; CHECK: normal_return:
13 ; CHECK-NEXT: ret void
14 ; CHECK: exceptional_return:
15 ; CHECK-NEXT: [[LANDING_PAD4:%.*]] = landingpad { ptr, i32 }
17 ; CHECK-NEXT: ret void
20 invoke void @f() "statepoint-id"="100" to label %normal_return unwind label %exceptional_return
26 %landing_pad4 = landingpad {ptr, i32} cleanup
30 define void @test_num_patch_bytes() gc "statepoint-example" personality ptr @personality_function {
31 ; CHECK-LABEL: @test_num_patch_bytes(
33 ; CHECK-NEXT: [[STATEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 99, ptr elementtype(void ()) @f, i32 0, i32 0, i32 0, i32 0)
34 ; CHECK-NEXT: to label [[NORMAL_RETURN:%.*]] unwind label [[EXCEPTIONAL_RETURN:%.*]]
35 ; CHECK: normal_return:
36 ; CHECK-NEXT: ret void
37 ; CHECK: exceptional_return:
38 ; CHECK-NEXT: [[LANDING_PAD4:%.*]] = landingpad { ptr, i32 }
40 ; CHECK-NEXT: ret void
43 invoke void @f() "statepoint-num-patch-bytes"="99" to label %normal_return unwind label %exceptional_return
49 %landing_pad4 = landingpad {ptr, i32} cleanup
53 declare void @do_safepoint()
54 define void @gc.safepoint_poll() {
55 ; CHECK-LABEL: @gc.safepoint_poll(
57 ; CHECK-NEXT: call void @do_safepoint()
58 ; CHECK-NEXT: ret void
61 call void @do_safepoint()
65 ; CHECK-NOT: statepoint-id
66 ; CHECK-NOT: statepoint-num-patch_bytes