[gc.statepoint] Change gc.statepoint intrinsic's return type to token type instead...
[oota-llvm.git] / test / Transforms / RewriteStatepointsForGC / relocate_invoke_result.ll
1 ;; RUN: opt -rewrite-statepoints-for-gc -verify -S < %s | FileCheck %s
2
3 ;; This test is to verify that RewriteStatepointsForGC correctly relocates values
4 ;; defined by invoke instruction results. 
5
6 declare i64* addrspace(1)* @non_gc_call()
7
8 declare void @gc_call()
9
10 declare i32* @fake_personality_function()
11
12 ; Function Attrs: nounwind
13 define i64* addrspace(1)* @test() gc "statepoint-example" personality i32* ()* @fake_personality_function {
14 entry:
15   %obj = invoke i64* addrspace(1)* @non_gc_call()
16           to label %normal_dest unwind label %unwind_dest
17
18 unwind_dest: 
19   %lpad = landingpad { i8*, i32 }
20           cleanup
21   resume { i8*, i32 } undef
22
23 normal_dest:
24 ;; CHECK-LABEL: normal_dest:
25 ;; CHECK-NEXT: gc.statepoint
26 ;; CHECK-NEXT: %obj.relocated = call coldcc i8 addrspace(1)*
27 ;; CHECK-NEXT: bitcast
28   %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @gc_call, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
29   ret i64* addrspace(1)* %obj
30 }
31
32 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
33