blob: 2f4193827ae705c48a1fa38caa7a405b77f49674 [file] [log] [blame]
Manuel Jacobb8060cd2016-01-05 19:40:58 +00001; RUN: opt %s -S -place-safepoints | FileCheck %s
2
3declare void @foo() "gc-leaf-function"
Manuel Jacob3eedd112016-01-05 23:59:08 +00004declare void @bar()
Manuel Jacobb8060cd2016-01-05 19:40:58 +00005
Manuel Jacob68b753a2016-01-05 19:45:54 +00006; Calls of functions with the "gc-leaf-function" attribute shouldn't be turned
7; into a safepoint. An entry safepoint should get inserted, though.
Manuel Jacobb8060cd2016-01-05 19:40:58 +00008define void @test_leaf_function() gc "statepoint-example" {
9; CHECK-LABEL: test_leaf_function
10; CHECK: gc.statepoint.p0f_isVoidf
11; CHECK-NOT: statepoint
12; CHECK-NOT: gc.result
13entry:
14 call void @foo()
15 ret void
16}
17
Manuel Jacob3eedd112016-01-05 23:59:08 +000018define void @test_leaf_function_call() gc "statepoint-example" {
19; CHECK-LABEL: test_leaf_function_call
20; CHECK: gc.statepoint.p0f_isVoidf
21; CHECK-NOT: statepoint
22; CHECK-NOT: gc.result
23entry:
24 call void @bar() "gc-leaf-function"
25 ret void
26}
27
Manuel Jacobb8060cd2016-01-05 19:40:58 +000028; This function is inlined when inserting a poll.
29declare void @do_safepoint()
30define void @gc.safepoint_poll() {
31; CHECK-LABEL: gc.safepoint_poll
32entry:
33 call void @do_safepoint()
34 ret void
35}