[opaque pointer type] Add textual IR support for explicit type parameter to the call...
[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" {
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 } personality i32* ()* @fake_personality_function
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 i64* addrspace(1)*                                      
27   %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @gc_call, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
28   ret i64* addrspace(1)* %obj
29 }
30
31 declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...)
32
33