|
1 | 1 | // RUN: %target-swift-emit-silgen %s | %FileCheck %s
|
2 |
| -// RUN: %target-swift-emit-silgen %s -enable-library-evolution |
| 2 | +// RUN: %target-swift-emit-silgen %s -enable-library-evolution | %FileCheck %s --check-prefix=CHECK-LIB |
3 | 3 |
|
4 | 4 | public protocol Foo {
|
5 | 5 | static var button: Self { get }
|
@@ -55,3 +55,27 @@ enum InternalEnumWithPublicStruct : Foo {
|
55 | 55 |
|
56 | 56 | // CHECK-LABEL: sil_witness_table [serialized] AnotherBar: AnotherFoo module protocol_enum_witness {
|
57 | 57 | // CHECK: method #AnotherFoo.bar: <Self where Self : AnotherFoo> (Self.Type) -> (Int) -> Self : @$s21protocol_enum_witness10AnotherBarOAA0D3FooA2aDP3bar3argxSi_tFZTW
|
| 58 | + |
| 59 | +// ----------------------------------------------------------------------------- |
| 60 | +// rdar://108001491 (SIL verification failed: Found mutating or consuming use of |
| 61 | +// an in_guaranteed parameter?!: |
| 62 | +// !ImmutableAddressUseVerifier().isMutatingOrConsuming(fArg)) |
| 63 | + |
| 64 | +public struct EntityIdentifier { |
| 65 | + public let value: Swift.UInt64 |
| 66 | +} |
| 67 | + |
| 68 | +public protocol ObjectProtocol { |
| 69 | + static func entityReference(_ id: EntityIdentifier) -> Self |
| 70 | +} |
| 71 | + |
| 72 | +public enum Object : ObjectProtocol { |
| 73 | + case entityReference(EntityIdentifier) |
| 74 | +} |
| 75 | + |
| 76 | +// CHECK-LIB-LABEL: sil private [transparent] [thunk] [ossa] @$s21protocol_enum_witness6ObjectOAA0D8ProtocolA2aDP15entityReferenceyxAA16EntityIdentifierVFZTW : $@convention(witness_method: ObjectProtocol) (@in_guaranteed EntityIdentifier, @thick Object.Type) -> @out Object { |
| 77 | +// CHECK-LIB: bb0(%0 : $*Object, %1 : $*EntityIdentifier, %2 : $@thick Object.Type): |
| 78 | +// CHECK-LIB: [[TEMP:%.*]] = alloc_stack $EntityIdentifier |
| 79 | +// CHECK-LIB: copy_addr %1 to [init] %3 : $*EntityIdentifier |
| 80 | +// CHECK-LIB: apply %{{.*}}(%0, [[TEMP]], %{{.*}}) : $@convention(method) (@in EntityIdentifier, @thin Object.Type) -> @out Object |
| 81 | +// CHECK-LIB-LABEL: } // end sil function '$s21protocol_enum_witness6ObjectOAA0D8ProtocolA2aDP15entityReferenceyxAA16EntityIdentifierVFZTW' |
0 commit comments