[PlaceSafepoints] Add a test.
[oota-llvm.git] / test / Transforms / PlaceSafepoints / leaf-function.ll
1 ; RUN: opt %s -S -place-safepoints | FileCheck %s
2
3 declare void @foo() "gc-leaf-function"
4
5 ; Calls of functions with the "gc-leaf-function" attribute shouldn't get
6 ; safepoints.  An entry safepoint should get inserted, though.
7 define void @test_leaf_function() gc "statepoint-example" {
8 ; CHECK-LABEL: test_leaf_function
9 ; CHECK: gc.statepoint.p0f_isVoidf
10 ; CHECK-NOT: statepoint
11 ; CHECK-NOT: gc.result
12 entry:
13   call void @foo()
14   ret void
15 }
16
17 ; This function is inlined when inserting a poll.
18 declare void @do_safepoint()
19 define void @gc.safepoint_poll() {
20 ; CHECK-LABEL: gc.safepoint_poll
21 entry:
22   call void @do_safepoint()
23   ret void
24 }