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