1 ; RUN: opt %s -S -place-safepoints | FileCheck %s
4 ; Do we insert a simple entry safepoint?
5 define void @test_entry(i8 addrspace(1)* %arg) {
6 ; CHECK-LABEL: @test_entry
13 ; Do we insert a backedge safepoint in a statically
15 define void @test_backedge(i8 addrspace(1)* %arg) {
16 ; CHECK-LABEL: test_backedge
19 ; This statepoint is technically not required, but we don't exploit that yet.
26 %tmp = bitcast i8 addrspace(1)* %arg to i32 addrspace(1)*
31 ; Check that we remove an unreachable block rather than trying
32 ; to insert a backedge safepoint
33 define void @test_unreachable(i8 addrspace(1)* %arg) {
34 ; CHECK-LABEL: test_unreachable
41 ; CHECK-NOT: statepoint
48 ; Do we turn a call into it's own statepoint
49 define void @test_simple_call() {
50 ; CHECK-LABEL: test_simple_call
61 ; This function is inlined when inserting a poll. To avoid recursive
62 ; issues, make sure we don't place safepoints in it.
63 declare void @do_safepoint()
64 define void @gc.safepoint_poll() {
65 ; CHECK-LABEL: gc.safepoint_poll
67 ; CHECK-NEXT: do_safepoint
68 ; CHECK-NEXT: ret void
70 call void @do_safepoint()