Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
[oota-llvm.git] / test / Transforms / PlaceSafepoints / statepoint-frameescape.ll
1 ; RUN: opt %s -S -place-safepoints | FileCheck %s
2
3 declare void @llvm.localescape(...)
4
5 ; Do we insert the entry safepoint after the localescape intrinsic?
6 define void @parent() gc "statepoint-example" {
7 ; CHECK-LABEL: @parent
8 entry:
9 ; CHECK-LABEL: entry
10 ; CHECK-NEXT: alloca
11 ; CHECK-NEXT: localescape
12 ; CHECK-NEXT: statepoint
13   %ptr = alloca i32
14   call void (...) @llvm.localescape(i32* %ptr)
15   ret void
16 }
17
18 ; This function is inlined when inserting a poll.  To avoid recursive 
19 ; issues, make sure we don't place safepoints in it.
20 declare void @do_safepoint()
21 define void @gc.safepoint_poll() {
22 ; CHECK-LABEL: gc.safepoint_poll
23 ; CHECK-LABEL: entry
24 ; CHECK-NEXT: do_safepoint
25 ; CHECK-NEXT: ret void 
26 entry:
27   call void @do_safepoint()
28   ret void
29 }