Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / Transforms / RewriteStatepointsForGC / patchable-statepoints.ll
blob839b24cd208f1ac9277cba9720e553514dcdb6c4
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
4 declare void @f()
5 declare i32 @personality_function()
7 define void @test_id() gc "statepoint-example" personality ptr @personality_function {
8 ; CHECK-LABEL: @test_id(
9 ; CHECK-NEXT:  entry:
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 }
16 ; CHECK-NEXT:    cleanup
17 ; CHECK-NEXT:    ret void
19 entry:
20   invoke void @f()  "statepoint-id"="100" to label %normal_return unwind label %exceptional_return
22 normal_return:
23   ret void
25 exceptional_return:
26   %landing_pad4 = landingpad {ptr, i32} cleanup
27   ret void
30 define void @test_num_patch_bytes() gc "statepoint-example" personality ptr @personality_function {
31 ; CHECK-LABEL: @test_num_patch_bytes(
32 ; CHECK-NEXT:  entry:
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 }
39 ; CHECK-NEXT:    cleanup
40 ; CHECK-NEXT:    ret void
42 entry:
43   invoke void @f()  "statepoint-num-patch-bytes"="99" to label %normal_return unwind label %exceptional_return
45 normal_return:
46   ret void
48 exceptional_return:
49   %landing_pad4 = landingpad {ptr, i32} cleanup
50   ret void
53 declare void @do_safepoint()
54 define void @gc.safepoint_poll() {
55 ; CHECK-LABEL: @gc.safepoint_poll(
56 ; CHECK-NEXT:  entry:
57 ; CHECK-NEXT:    call void @do_safepoint()
58 ; CHECK-NEXT:    ret void
60 entry:
61   call void @do_safepoint()
62   ret void
65 ; CHECK-NOT: statepoint-id
66 ; CHECK-NOT: statepoint-num-patch_bytes