blob: e2350d4f9e0a29d624b49259c7a060b87bc2d493 [file] [log] [blame]
Sanjoy Das04071082016-01-29 00:28:57 +00001; RUN: opt < %s -S -rewrite-statepoints-for-gc | FileCheck %s
Manuel Jacobb8060cd2016-01-05 19:40:58 +00002
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
Sanjoy Dasf7302c82016-01-28 21:51:14 +000010; CHECK-NOT: gc.statepoint
Manuel Jacobb8060cd2016-01-05 19:40:58 +000011; CHECK-NOT: gc.result
12entry:
13 call void @foo()
14 ret void
15}
16
Manuel Jacob3eedd112016-01-05 23:59:08 +000017define void @test_leaf_function_call() gc "statepoint-example" {
18; CHECK-LABEL: test_leaf_function_call
Sanjoy Dasf7302c82016-01-28 21:51:14 +000019; CHECK-NOT: gc.statepoint
Manuel Jacob3eedd112016-01-05 23:59:08 +000020; CHECK-NOT: gc.result
21entry:
22 call void @bar() "gc-leaf-function"
23 ret void
24}
25
Manuel Jacobb8060cd2016-01-05 19:40:58 +000026; This function is inlined when inserting a poll.
27declare void @do_safepoint()
28define void @gc.safepoint_poll() {
29; CHECK-LABEL: gc.safepoint_poll
30entry:
31 call void @do_safepoint()
32 ret void
33}