mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
35 lines
1.4 KiB
Plaintext
35 lines
1.4 KiB
Plaintext
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -enable-resilience -o %t/Conformances.swiftmodule %s
|
|
// RUN: %target-swift-frontend -emit-sil -I %t %S/Inputs/ConformancesUser.swift -O | %FileCheck %s
|
|
|
|
public protocol MyProto {
|
|
init()
|
|
func method()
|
|
var prop: Int { get set }
|
|
subscript(index: Int) -> Int { get set }
|
|
}
|
|
|
|
@_fixed_layout // allow conformance devirtualization
|
|
public struct FullStructImpl: MyProto {
|
|
public init()
|
|
public func method()
|
|
public var prop: Int { get set }
|
|
public subscript(index: Int) -> Int { get set }
|
|
}
|
|
// CHECK-LABEL: sil @$s16ConformancesUser8testFullSiyF
|
|
// CHECK: function_ref @$s12Conformances14FullStructImplVACycfC
|
|
// CHECK: function_ref @$s12Conformances14FullStructImplV6methodyyF
|
|
// CHECK: function_ref @$s12Conformances14FullStructImplV4propSivs
|
|
// CHECK: function_ref @$s12Conformances14FullStructImplVyS2icig
|
|
// CHECK: end sil function '$s16ConformancesUser8testFullSiyF'
|
|
|
|
@_fixed_layout // allow conformance devirtualization
|
|
public struct OpaqueStructImpl: MyProto {}
|
|
|
|
// CHECK-LABEL: sil @$s16ConformancesUser10testOpaqueSiyF
|
|
// CHECK: function_ref @$s12Conformances7MyProtoPxycfC
|
|
// CHECK: function_ref @$s12Conformances7MyProtoP6methodyyF
|
|
// CHECK: function_ref @$s12Conformances7MyProtoP4propSivs
|
|
// CHECK: function_ref @$s12Conformances7MyProtoPyS2icig
|
|
// CHECK: end sil function '$s16ConformancesUser10testOpaqueSiyF'
|