@@ -112,6 +112,19 @@ func test1(_ a: Array<Int>) {
112112 }
113113}
114114
115+ // CHECK-LABEL: sil private @$s31lifetime_dependence_scope_fixup5test2yySaySiGFySWXEfU_ : $@convention(thin) @substituted <τ_0_0> (UnsafeRawBufferPointer) -> (@out τ_0_0, @error any Error) for <()> {
116+ // CHECK: [[CONT:%.*]] = alloc_stack [lexical] $NCContainer, var, name "x"
117+ // CHECK: [[BA:%.*]] = begin_access [read] [static] [[CONT]] : $*NCContainer
118+ // CHECK: [[LD:%.*]] = load [[CONT]] : $*NCContainer
119+ // CHECK: [[FUNC:%.*]] = function_ref @$s31lifetime_dependence_scope_fixup16getBorrowingViewyAA0G0VAA11NCContainerVYlsF : $@convention(thin) (@guaranteed NCContainer) -> _scope(1) @owned View
120+ // CHECK: [[VIEW:%.*]] = apply [[FUNC]]([[LD]]) : $@convention(thin) (@guaranteed NCContainer) -> _scope(1) @owned View
121+ // CHECK: [[MDI:%.*]] = mark_dependence [nonescaping] [[VIEW]] : $View on [[BA]] : $*NCContainer
122+ // CHECK: [[USE:%.*]] = function_ref @$s31lifetime_dependence_scope_fixup3useyyAA4ViewVF : $@convention(thin) (@guaranteed View) -> ()
123+ // CHECK: apply [[USE]]([[MDI]]) : $@convention(thin) (@guaranteed View) -> ()
124+ // CHECK: [[CONSUME:%.*]] = function_ref @$s31lifetime_dependence_scope_fixup7consumeyyAA4ViewVnF : $@convention(thin) (@owned View) -> ()
125+ // CHECK: apply [[CONSUME]]([[VIEW]]) : $@convention(thin) (@owned View) -> ()
126+ // CHECK: end_access [[BA]] : $*NCContainer
127+ // CHECK-LABEL: } // end sil function '$s31lifetime_dependence_scope_fixup5test2yySaySiGFySWXEfU_'
115128func test2( _ a: Array < Int > ) {
116129 a. withUnsafeBytes {
117130 var x = NCContainer ( $0, a. count)
@@ -166,6 +179,18 @@ func test6(_ a: Array<Int>) {
166179 use ( p!)
167180}
168181
182+ // CHECK-LABEL: sil hidden @$s31lifetime_dependence_scope_fixup5test7yySWF : $@convention(thin) (UnsafeRawBufferPointer) -> () {
183+ // CHECK: [[CONT:%.*]] = alloc_stack $NEContainer, var, name "x"
184+ // CHECK: [[BA:%.*]] = begin_access [read] [static] [[CONT]] : $*NEContainer
185+ // CHECK: [[LD:%.*]] = load [[BA]] : $*NEContainer
186+ // CHECK: [[FUNC:%.*]] = function_ref @$s31lifetime_dependence_scope_fixup16getBorrowingViewyAA0G0VAA11NEContainerVYlsF : $@convention(thin) (@guaranteed NEContainer) -> _scope(1) @owned View
187+ // CHECK: [[VIEW:%.*]] = apply [[FUNC]]([[LD]]) : $@convention(thin) (@guaranteed NEContainer) -> _scope(1) @owned View
188+ // CHECK: [[MDI:%.*]] = mark_dependence [nonescaping] [[VIEW]] : $View on [[BA]] : $*NEContainer
189+ // CHECK: [[USE:%.*]] = function_ref @$s31lifetime_dependence_scope_fixup3useyyAA4ViewVF : $@convention(thin) (@guaranteed View) -> ()
190+ // CHECK: apply [[USE]]([[MDI]]) : $@convention(thin) (@guaranteed View) -> ()
191+ // CHECK: release_value [[MDI]] : $View
192+ // CHECK: end_access [[BA]] : $*NEContainer
193+ // CHECK-LABEL: } // end sil function '$s31lifetime_dependence_scope_fixup5test7yySWF'
169194func test7( _ a: UnsafeRawBufferPointer ) {
170195 var x = NEContainer ( a, a. count)
171196 do {
0 commit comments