1 ; RUN: opt < %s -passes=rewrite-statepoints-for-gc -S | FileCheck %s
3 declare void @some_call(ptr addrspace(1))
5 declare i32 @dummy_personality_function()
7 define ptr addrspace(1) @test(ptr addrspace(1) %obj, ptr addrspace(1) %obj1)
8 gc "statepoint-example"
9 personality ptr @dummy_personality_function {
11 invoke void @some_call(ptr addrspace(1) %obj) [ "deopt"() ]
12 to label %second_invoke unwind label %exceptional_return
14 second_invoke: ; preds = %entry
15 invoke void @some_call(ptr addrspace(1) %obj) [ "deopt"() ]
16 to label %normal_return unwind label %exceptional_return
18 normal_return: ; preds = %second_invoke
19 ret ptr addrspace(1) %obj
21 ; CHECK: exceptional_return1:
22 ; CHECK-NEXT: %lpad2 = landingpad token
24 ; CHECK: exceptional_return.split-lp:
25 ; CHECK-NEXT: %lpad.split-lp = landingpad token
27 ; CHECK: exceptional_return:
28 ; CHECK-NOT: phi token
30 exceptional_return: ; preds = %second_invoke, %entry
31 %lpad = landingpad token cleanup
32 ret ptr addrspace(1) %obj1