blob: 71e7a46bc78bf1516a543048a9de064b804502f6 [file] [log] [blame]
// RUN: %target-sil-opt -enable-sil-verify-all %s -early-inline -sil-inline-threshold=50 | FileCheck %s
sil_stage canonical
import Builtin
import Swift
import SwiftShims
//CHECK-LABEL: caller_function
//CHECK-NOT: try_apply
//CHECK: throw {{.*}} : $ErrorType
sil @caller_function : $@convention(thin) () -> @error ErrorType {
bb0:
// function_ref main.inner () throws -> ()
%0 = function_ref @callee_function : $@convention(thin) () -> @error ErrorType // user: %1
try_apply %0() : $@convention(thin) () -> @error ErrorType, normal bb1, error bb2 // id: %1
bb1(%2 : $()): // Preds: bb0
%3 = tuple () // user: %4
return %3 : $() // id: %4
bb2(%5 : $ErrorType): // Preds: bb0
throw %5 : $ErrorType // id: %6
}
//CHECK-LABEL: callee_function
//CHECK: return
// main.inner () throws -> ()
sil [always_inline] @callee_function : $@convention(thin) () -> @error ErrorType {
bb0:
%0 = tuple () // user: %1
return %0 : $() // id: %1
}