32 lines · plain
1; RUN: opt < %s -S -passes=rewrite-statepoints-for-gc | FileCheck %s2 3; Basic test to make sure that safepoints are placed4; for CoreCLR GC5 6declare void @foo()7 8define void @test_simple_call() gc "coreclr" {9; CHECK-LABEL: test_simple_call10entry:11 br label %other12other:13; CHECK-LABEL: other14; CHECK: statepoint15; CHECK-NOT: gc.result16 call void @foo()17 ret void18}19 20; This function is inlined when inserting a poll. To avoid recursive21; issues, make sure we don't place safepoints in it.22declare void @do_safepoint()23define void @gc.safepoint_poll() {24; CHECK-LABEL: gc.safepoint_poll25; CHECK-LABEL: entry26; CHECK-NEXT: do_safepoint27; CHECK-NEXT: ret void28entry:29 call void @do_safepoint()30 ret void31}32