• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -S -rewrite-statepoints-for-gc | FileCheck %s
2; RUN: opt < %s -S -passes=rewrite-statepoints-for-gc | FileCheck %s
3
4declare void @foo() "gc-leaf-function"
5declare void @bar()
6
7; Calls of functions with the "gc-leaf-function" attribute shouldn't be turned
8; into a safepoint.  An entry safepoint should get inserted, though.
9define void @test_leaf_function() gc "statepoint-example" {
10; CHECK-LABEL: test_leaf_function
11; CHECK-NOT: gc.statepoint
12; CHECK-NOT: gc.result
13entry:
14  call void @foo()
15  ret void
16}
17
18define void @test_leaf_function_call() gc "statepoint-example" {
19; CHECK-LABEL: test_leaf_function_call
20; CHECK-NOT: gc.statepoint
21; CHECK-NOT: gc.result
22entry:
23  call void @bar() "gc-leaf-function"
24  ret void
25}
26
27; This function is inlined when inserting a poll.
28declare void @do_safepoint()
29define void @gc.safepoint_poll() {
30; CHECK-LABEL: gc.safepoint_poll
31entry:
32  call void @do_safepoint()
33  ret void
34}
35