1 ; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s 2 3 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" 4 target triple = "x86_64-apple-macosx10.11.0" 5 6 declare i32 @llvm.experimental.deoptimize.i32(...) 7 declare void @llvm.experimental.deoptimize.isVoid(...) 8 9 define i32 @caller_0(i32 addrspace(1)* %ptr) gc "statepoint-example" { 10 ; CHECK-LABEL: @caller_0( 11 ; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @__llvm_deoptimize, i32 0 12 ; CHECK: unreachable 13 entry: 14 %v = call i32(...) @llvm.experimental.deoptimize.i32() [ "deopt"(i32 0, i32 addrspace(1)* %ptr) ] 15 ret i32 %v 16 } 17 18 19 define i32 @caller_1(i32 addrspace(1)* %ptr) gc "statepoint-example" { 20 ; CHECK-LABEL: @caller_1 21 ; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidi32p1i32f(i64 2882400000, i32 0, void (i32, i32 addrspace(1)*)* bitcast (void ()* @__llvm_deoptimize to void (i32, i32 addrspace(1)*)*), i32 2, i32 0, i32 50, i32 addrspace(1)* %ptr 22 ; CHECK: unreachable 23 entry: 24 %v = call i32(...) @llvm.experimental.deoptimize.i32(i32 50, i32 addrspace(1)* %ptr) [ "deopt"(i32 0) ] 25 ret i32 %v 26 } 27 28 define void @caller_2(i32 addrspace(1)* %ptr) gc "statepoint-example" { 29 ; CHECK-LABEL: @caller_2( 30 ; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @__llvm_deoptimize, i32 0 31 ; CHECK: unreachable 32 entry: 33 call void(...) @llvm.experimental.deoptimize.isVoid() [ "deopt"(i32 0, i32 addrspace(1)* %ptr) ] 34 ret void 35 } 36