1 ; RUN: opt %s -S -place-safepoints | FileCheck %s
4 ; Do we insert a simple entry safepoint?
5 define void @test_entry() gc "statepoint-example" {
6 ; CHECK-LABEL: @test_entry
13 ; Do we insert a backedge safepoint in a statically
15 define void @test_backedge() gc "statepoint-example" {
16 ; CHECK-LABEL: test_backedge
19 ; This statepoint is technically not required, but we don't exploit that yet.
30 ; Check that we remove an unreachable block rather than trying
31 ; to insert a backedge safepoint
32 define void @test_unreachable() gc "statepoint-example" {
33 ; CHECK-LABEL: test_unreachable
40 ; CHECK-NOT: statepoint
47 ; Do we turn a call into it's own statepoint
48 define void @test_simple_call() gc "statepoint-example" {
49 ; CHECK-LABEL: test_simple_call
55 ; CHECK-NOT: gc.result
60 declare zeroext i1 @i1_return_i1(i1)
62 define i1 @test_call_with_result() gc "statepoint-example" {
63 ; CHECK-LABEL: test_call_with_result
64 ; This is checking that a statepoint_poll + statepoint + result is
65 ; inserted for a function that takes 1 argument.
66 ; CHECK: gc.statepoint.p0f_isVoidf
67 ; CHECK: gc.statepoint.p0f_i1i1f
68 ; CHECK: (i1 (i1)* @i1_return_i1, i32 1, i32 0, i1 false, i32 0)
71 %call1 = tail call i1 (i1)* @i1_return_i1(i1 false)
75 ; This function is inlined when inserting a poll. To avoid recursive
76 ; issues, make sure we don't place safepoints in it.
77 declare void @do_safepoint()
78 define void @gc.safepoint_poll() {
79 ; CHECK-LABEL: gc.safepoint_poll
81 ; CHECK-NEXT: do_safepoint
82 ; CHECK-NEXT: ret void
84 call void @do_safepoint()