llvm.org GIT mirror llvm / 32704d0
[PlaceSafepoints] Add a test. Calls of functions with the "gc-leaf-function" attribute shouldn't be turned into a safepoint. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256860 91177308-0d34-0410-b5e6-96231b3b80d8 Manuel Jacob 3 years ago
1 changed file(s) with 24 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt %s -S -place-safepoints | FileCheck %s
1
2 declare void @foo() "gc-leaf-function"
3
4 ; Calls of functions with the "gc-leaf-function" attribute shouldn't get
5 ; safepoints. An entry safepoint should get inserted, though.
6 define void @test_leaf_function() gc "statepoint-example" {
7 ; CHECK-LABEL: test_leaf_function
8 ; CHECK: gc.statepoint.p0f_isVoidf
9 ; CHECK-NOT: statepoint
10 ; CHECK-NOT: gc.result
11 entry:
12 call void @foo()
13 ret void
14 }
15
16 ; This function is inlined when inserting a poll.
17 declare void @do_safepoint()
18 define void @gc.safepoint_poll() {
19 ; CHECK-LABEL: gc.safepoint_poll
20 entry:
21 call void @do_safepoint()
22 ret void
23 }