mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
25 lines
724 B
Swift
25 lines
724 B
Swift
// RUN: %target-swift-frontend -emit-sil -O -primary-file %s | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
@objc protocol P {}
|
|
|
|
@_semantics("optimize.sil.never")
|
|
func takesP<T : P>(_: T) {}
|
|
|
|
@inline(__always)
|
|
func callsTakesP<T : P>(_ t: T) {
|
|
takesP(t)
|
|
}
|
|
|
|
// CHECK-LABEL: sil hidden @_T026specialize_self_conforming16callsTakesPWithPyAA1P_pF : $@convention(thin) (@owned P) -> () {
|
|
// CHECK: [[FN:%.*]] = function_ref @_T026specialize_self_conforming6takesPyxAA1PRzlF : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@owned τ_0_0) -> ()
|
|
// CHECK: apply [[FN]]<P>(%0) : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@owned τ_0_0) -> ()
|
|
// CHECK: return
|
|
|
|
func callsTakesPWithP(_ p: P) {
|
|
callsTakesP(p)
|
|
}
|