1; RUN: opt < %s -S -rewrite-statepoints-for-gc | FileCheck %s
2; RUN: opt < %s -S -passes=rewrite-statepoints-for-gc | FileCheck %s
3
4; Basic test to make sure that safepoints are placed
5; for CoreCLR GC
6
7declare void @foo()
8
9define void @test_simple_call() gc "coreclr" {
10; CHECK-LABEL: test_simple_call
11entry:
12  br label %other
13other:
14; CHECK-LABEL: other
15; CHECK: statepoint
16; CHECK-NOT: gc.result
17  call void @foo()
18  ret void
19}
20
21; This function is inlined when inserting a poll.  To avoid recursive
22; issues, make sure we don't place safepoints in it.
23declare void @do_safepoint()
24define void @gc.safepoint_poll() {
25; CHECK-LABEL: gc.safepoint_poll
26; CHECK-LABEL: entry
27; CHECK-NEXT: do_safepoint
28; CHECK-NEXT: ret void
29entry:
30  call void @do_safepoint()
31  ret void
32}
33