|
1 |
| -// RUN: %target-swift-emit-silgen %s | %FileCheck %s |
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: %target-swift-frontend -emit-module -o %t -enable-library-evolution %S/Inputs/def_structA.swift |
| 3 | +// RUN: %target-swift-emit-silgen %s -I %t | %FileCheck %s |
| 4 | +import def_structA |
2 | 5 |
|
3 | 6 | public struct Projection<T> {
|
4 | 7 | public var wrappedValue: T
|
@@ -283,3 +286,18 @@ func testNonmutatingSetterSynthesis(@NonmutatingSetter value: Int) {
|
283 | 286 | // CHECK-LABEL: sil private [ossa] @$s26property_wrapper_parameter30testNonmutatingSetterSynthesis5valueyAA0eF0VySiG_tFSiAFcfu_SiAFcfU_ACL_Sivs : $@convention(thin) (Int, NonmutatingSetter<Int>) -> ()
|
284 | 287 | // CHECK: function_ref @$s26property_wrapper_parameter17NonmutatingSetterV12wrappedValuexvs : $@convention(method) <τ_0_0> (@in τ_0_0, NonmutatingSetter<τ_0_0>) -> ()
|
285 | 288 | }
|
| 289 | + |
| 290 | +// CHECK-LABEL: sil hidden [ossa] @$s26property_wrapper_parameter38testImplicitWrapperWithResilientStructyyF : $@convention(thin) () -> () |
| 291 | +func testImplicitWrapperWithResilientStruct() { |
| 292 | + let _: (ProjectionWrapper<A>) -> Void = { $value in } |
| 293 | + |
| 294 | + // implicit closure #1 in testImplicitWrapperWithResilientStruct() |
| 295 | + // CHECK-LABEL: sil private [ossa] @$s26property_wrapper_parameter38testImplicitWrapperWithResilientStructyyFyAA010ProjectionF0Vy11def_structA1AVGcfu_ : $@convention(thin) (@in_guaranteed ProjectionWrapper<A>) -> () |
| 296 | + // CHECK: [[P:%.*]] = alloc_stack $ProjectionWrapper<A> |
| 297 | + // CHECK: copy_addr %0 to [initialization] [[P]] |
| 298 | + // CHECK: [[I:%.*]] = function_ref @$s26property_wrapper_parameter38testImplicitWrapperWithResilientStructyyFyAA010ProjectionF0Vy11def_structA1AVGcfu_yAHcfU_6$valueL_AHvpfW : $@convention(thin) (@in ProjectionWrapper<A>) -> @out ProjectionWrapper<A> |
| 299 | + // CHECK: apply [[I]]({{.*}}, [[P]]) : $@convention(thin) (@in ProjectionWrapper<A>) -> @out ProjectionWrapper<A> |
| 300 | + |
| 301 | + // property wrapper init from projected value of $value #1 in closure #1 in implicit closure #1 in testImplicitWrapperWithResilientStruct() |
| 302 | + // CHECK-LABEL: sil private [ossa] @$s26property_wrapper_parameter38testImplicitWrapperWithResilientStructyyFyAA010ProjectionF0Vy11def_structA1AVGcfu_yAHcfU_6$valueL_AHvpfW : $@convention(thin) (@in ProjectionWrapper<A>) -> @out ProjectionWrapper<A> |
| 303 | +} |
0 commit comments