Skip to content

Commit 7499cf3

Browse files
committed
Update lifetime dependence tests
1 parent 7d2ff43 commit 7499cf3

11 files changed

+96
-59
lines changed

test/SIL/explicit_lifetime_dependence_specifiers.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// RUN: -enable-builtin-module \
44
// RUN: -enable-experimental-feature NonescapableTypes | %FileCheck %s
55

6-
76
import Builtin
87

98
struct BufferView : ~Escapable {
109
let ptr: UnsafeRawBufferPointer
10+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACYlsSU_SWcfC : $@convention(method) (UnsafeRawBufferPointer, @thin BufferView.Type) -> _scope(0) @owned BufferView {
1111
init(_ ptr: UnsafeRawBufferPointer) -> dependsOn(ptr) Self {
1212
self.ptr = ptr
1313
}
@@ -23,17 +23,17 @@ struct BufferView : ~Escapable {
2323
init(independent ptr: UnsafeRawBufferPointer) {
2424
self.ptr = ptr
2525
}
26-
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACSW_SaySiGhYlstcfC : $@convention(method) (UnsafeRawBufferPointer, @guaranteed Array<Int>, @thin BufferView.Type) -> _scope(1) @owned BufferView {
26+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACYlsUSU_SW_SaySiGhtcfC : $@convention(method) (UnsafeRawBufferPointer, @guaranteed Array<Int>, @thin BufferView.Type) -> _scope(1) @owned BufferView {
2727
init(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Int>) -> dependsOn(a) Self {
2828
self.ptr = ptr
2929
return self
3030
}
31-
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACSW_AA7WrapperVYlitcfC : $@convention(method) (UnsafeRawBufferPointer, @owned Wrapper, @thin BufferView.Type) -> _inherit(1) @owned BufferView {
31+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACYliUSU_SW_AA7WrapperVtcfC : $@convention(method) (UnsafeRawBufferPointer, @owned Wrapper, @thin BufferView.Type) -> _inherit(1) @owned BufferView {
3232
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper) -> dependsOn(a) Self {
3333
self.ptr = ptr
3434
return self
3535
}
36-
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACSW_AA7WrapperVYliSaySiGhYlstcfC : $@convention(method) (UnsafeRawBufferPointer, @owned Wrapper, @guaranteed Array<Int>, @thin BufferView.Type) -> _inherit(1) _scope(2) @owned BufferView {
36+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACYliUSUU_YlsUUSU_SW_AA7WrapperVSaySiGhtcfC : $@convention(method) (UnsafeRawBufferPointer, @owned Wrapper, @guaranteed Array<Int>, @thin BufferView.Type) -> _inherit(1) _scope(2) @owned BufferView {
3737
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper, _ b: borrowing Array<Int>) -> dependsOn(a) dependsOn(b) Self {
3838
self.ptr = ptr
3939
return self
@@ -58,25 +58,25 @@ func testBasic() {
5858
}
5959
}
6060

61-
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers6deriveyAA10BufferViewVADYlsF : $@convention(thin) (@guaranteed BufferView) -> _scope(0) @owned BufferView {
61+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers6deriveyAA10BufferViewVYlsS_ADF : $@convention(thin) (@guaranteed BufferView) -> _scope(0) @owned BufferView {
6262
func derive(_ x: borrowing BufferView) -> dependsOn(scoped x) BufferView {
6363
return BufferView(independent: x.ptr)
6464
}
6565

66-
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers16consumeAndCreateyAA10BufferViewVADnYliF : $@convention(thin) (@owned BufferView) -> _inherit(0) @owned BufferView {
66+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers16consumeAndCreateyAA10BufferViewVYliS_ADnF : $@convention(thin) (@owned BufferView) -> _inherit(0) @owned BufferView {
6767
func consumeAndCreate(_ x: consuming BufferView) -> dependsOn(x) BufferView {
6868
return BufferView(independent: x.ptr)
6969
}
7070

71-
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers17deriveThisOrThat1yAA10BufferViewVADYls_ADYlstF : $@convention(thin) (@guaranteed BufferView, @guaranteed BufferView) -> _scope(0, 1) @owned BufferView {
71+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers17deriveThisOrThat1yAA10BufferViewVYlsSS_AD_ADtF : $@convention(thin) (@guaranteed BufferView, @guaranteed BufferView) -> _scope(0, 1) @owned BufferView {
7272
func deriveThisOrThat1(_ this: borrowing BufferView, _ that: borrowing BufferView) -> dependsOn(scoped this, that) BufferView {
7373
if (Int.random(in: 1..<100) == 0) {
7474
return BufferView(independent: this.ptr)
7575
}
7676
return BufferView(independent: that.ptr)
7777
}
7878

79-
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers17deriveThisOrThat2yAA10BufferViewVADYls_ADnYlitF : $@convention(thin) (@guaranteed BufferView, @owned BufferView) -> _inherit(1) _scope(0) @owned BufferView {
79+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers17deriveThisOrThat2yAA10BufferViewVYliUS_YlsSU_AD_ADntF : $@convention(thin) (@guaranteed BufferView, @owned BufferView) -> _inherit(1) _scope(0) @owned BufferView {
8080
func deriveThisOrThat2(_ this: borrowing BufferView, _ that: consuming BufferView) -> dependsOn(scoped this) dependsOn(that) BufferView {
8181
if (Int.random(in: 1..<100) == 0) {
8282
return BufferView(independent: this.ptr)
@@ -91,12 +91,12 @@ struct Wrapper : ~Escapable {
9191
init(_ view: consuming BufferView) {
9292
self.view = view
9393
}
94-
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers7WrapperV8getView1AA10BufferViewVyYLsF : $@convention(method) (@guaranteed Wrapper) -> _scope(0) @owned BufferView {
94+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers7WrapperV8getView1AA10BufferViewVYlsS_yF : $@convention(method) (@guaranteed Wrapper) -> _scope(0) @owned BufferView {
9595
borrowing func getView1() -> dependsOn(scoped self) BufferView {
9696
return view
9797
}
9898

99-
// CHECK: sil hidden @$s39explicit_lifetime_dependence_specifiers7WrapperV8getView2AA10BufferViewVyYLiF : $@convention(method) (@owned Wrapper) -> _inherit(0) @owned BufferView {
99+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers7WrapperV8getView2AA10BufferViewVYliS_yF : $@convention(method) (@owned Wrapper) -> _inherit(0) @owned BufferView {
100100
consuming func getView2() -> dependsOn(self) BufferView {
101101
return view
102102
}
@@ -109,12 +109,12 @@ struct Container : ~Escapable {
109109
}
110110
}
111111

112-
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers16getConsumingViewyAA06BufferG0VAA9ContainerVnYliF : $@convention(thin) (@owned Container) -> _inherit(0) @owned BufferView {
112+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers16getConsumingViewyAA06BufferG0VYliS_AA9ContainerVnF : $@convention(thin) (@owned Container) -> _inherit(0) @owned BufferView {
113113
func getConsumingView(_ x: consuming Container) -> dependsOn(x) BufferView {
114114
return BufferView(independent: x.ptr)
115115
}
116116

117-
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers16getBorrowingViewyAA06BufferG0VAA9ContainerVYlsF : $@convention(thin) (@guaranteed Container) -> _scope(0) @owned BufferView {
117+
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers16getBorrowingViewyAA06BufferG0VYlsS_AA9ContainerVF : $@convention(thin) (@guaranteed Container) -> _scope(0) @owned BufferView {
118118
func getBorrowingView(_ x: borrowing Container) -> dependsOn(scoped x) BufferView {
119119
return BufferView(independent: x.ptr)
120120
}

test/SIL/implicit_lifetime_dependence.swift

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ struct BufferView : ~Escapable {
1515
self.ptr = ptr
1616
self.c = c
1717
}
18-
// CHECK: sil hidden @$s28implicit_lifetime_dependence10BufferViewVyA2ChYlicfC : $@convention(method) (@guaranteed BufferView, @thin BufferView.Type) -> _inherit(0) @owned BufferView {
18+
// CHECK-LABEL: sil hidden @$s28implicit_lifetime_dependence10BufferViewVyACYliSU_AChcfC : $@convention(method) (@guaranteed BufferView, @thin BufferView.Type) -> _inherit(0) @owned BufferView {
1919
init(_ otherBV: borrowing BufferView) {
2020
self.ptr = otherBV.ptr
2121
self.c = otherBV.c
2222
}
23-
// CHECK: sil hidden @$s28implicit_lifetime_dependence10BufferViewVyA2CYlicfC : $@convention(method) (@owned BufferView, @thin BufferView.Type) -> _inherit(0) @owned BufferView {
23+
// CHECK-LABEL: sil hidden @$s28implicit_lifetime_dependence10BufferViewVyACYliSU_ACcfC : $@convention(method) (@owned BufferView, @thin BufferView.Type) -> _inherit(0) @owned BufferView {
2424
init(_ otherBV: consuming BufferView) {
2525
self.ptr = otherBV.ptr
2626
self.c = otherBV.c
2727
}
28-
// CHECK: sil hidden @$s28implicit_lifetime_dependence10BufferViewVyACSW_SaySiGhYlstcfC : $@convention(method) (UnsafeRawBufferPointer, @guaranteed Array<Int>, @thin BufferView.Type) -> _scope(1) @owned BufferView {
28+
// CHECK-LABEL: sil hidden @$s28implicit_lifetime_dependence10BufferViewVyACYlsUSU_SW_SaySiGhtcfC : $@convention(method) (UnsafeRawBufferPointer, @guaranteed Array<Int>, @thin BufferView.Type) -> _scope(1) @owned BufferView {
2929
init(_ ptr: UnsafeRawBufferPointer, _ a: borrowing Array<Int>) {
3030
self.ptr = ptr
3131
self.c = a.count
@@ -51,7 +51,7 @@ func testBasic() {
5151
}
5252
}
5353

54-
// CHECK: sil hidden @$s28implicit_lifetime_dependence6deriveyAA10BufferViewVADYliF : $@convention(thin) (@guaranteed BufferView) -> _inherit(0) @owned BufferView {
54+
// CHECK-LABEL: sil hidden @$s28implicit_lifetime_dependence6deriveyAA10BufferViewVYliS_ADF : $@convention(thin) (@guaranteed BufferView) -> _inherit(0) @owned BufferView {
5555
func derive(_ x: borrowing BufferView) -> BufferView {
5656
return BufferView(x.ptr, x.c)
5757
}
@@ -60,7 +60,7 @@ func derive(_ unused: Int, _ x: borrowing BufferView) -> BufferView {
6060
return BufferView(independent: x.ptr, x.c)
6161
}
6262

63-
// CHECK: sil hidden @$s28implicit_lifetime_dependence16consumeAndCreateyAA10BufferViewVADnYliF : $@convention(thin) (@owned BufferView) -> _inherit(0) @owned BufferView {
63+
// CHECK-LABEL: sil hidden @$s28implicit_lifetime_dependence16consumeAndCreateyAA10BufferViewVYliS_ADnF : $@convention(thin) (@owned BufferView) -> _inherit(0) @owned BufferView {
6464
func consumeAndCreate(_ x: consuming BufferView) -> BufferView {
6565
return BufferView(independent: x.ptr, x.c)
6666
}
@@ -79,17 +79,16 @@ struct Wrapper : ~Escapable {
7979
yield &_view
8080
}
8181
}
82-
// CHECK: sil hidden @$s28implicit_lifetime_dependence7WrapperVyAcA10BufferViewVYlicfC : $@convention(method) (@owned BufferView, @thin Wrapper.Type) -> _inherit(0) @owned Wrapper {
82+
// CHECK-LABEL: sil hidden @$s28implicit_lifetime_dependence7WrapperVyACYliSU_AA10BufferViewVcfC : $@convention(method) (@owned BufferView, @thin Wrapper.Type) -> _inherit(0) @owned Wrapper {
8383
init(_ view: consuming BufferView) {
8484
self._view = view
8585
}
86-
// TODO: Investigate why it was mangled as Yli and not YLi before
87-
// CHECK: sil hidden @$s28implicit_lifetime_dependence7WrapperV8getView1AA10BufferViewVyKYLiF : $@convention(method) (@guaranteed Wrapper) -> _inherit(0) (@owned BufferView, @error any Error) {
86+
// CHECK-LABEL: sil hidden @$s28implicit_lifetime_dependence7WrapperV8getView1AA10BufferViewVYliS_yKF : $@convention(method) (@guaranteed Wrapper) -> _inherit(0) (@owned BufferView, @error any Error) {
8887
borrowing func getView1() throws -> BufferView {
8988
return _view
9089
}
9190

92-
// CHECK: sil hidden @$s28implicit_lifetime_dependence7WrapperV8getView2AA10BufferViewVyYaKYLiF : $@convention(method) @async (@owned Wrapper) -> _inherit(0) (@owned BufferView, @error any Error) {
91+
// CHECK-LABEL: sil hidden @$s28implicit_lifetime_dependence7WrapperV8getView2AA10BufferViewVYliS_yYaKF : $@convention(method) @async (@owned Wrapper) -> _inherit(0) (@owned BufferView, @error any Error) {
9392
consuming func getView2() async throws -> BufferView {
9493
return _view
9594
}
@@ -130,7 +129,7 @@ struct GenericBufferView<Element> : ~Escapable {
130129
let baseAddress: Pointer
131130
let count: Int
132131

133-
// CHECK: sil hidden @$s28implicit_lifetime_dependence17GenericBufferViewV11baseAddress5count9dependsOnACyxGSV_Siqd__hYlstclufC : $@convention(method) <Element><Storage> (UnsafeRawPointer, Int, @in_guaranteed Storage, @thin GenericBufferView<Element>.Type) -> _scope(2) @owned GenericBufferView<Element> {
132+
// CHECK-LABEL: sil hidden @$s28implicit_lifetime_dependence17GenericBufferViewV11baseAddress5count9dependsOnACyxGYlsUUSU_SV_Siqd__htclufC : $@convention(method) <Element><Storage> (UnsafeRawPointer, Int, @in_guaranteed Storage, @thin GenericBufferView<Element>.Type) -> _scope(2) @owned GenericBufferView<Element> {
134133
init<Storage>(baseAddress: Pointer,
135134
count: Int,
136135
dependsOn: borrowing Storage) {
@@ -164,7 +163,7 @@ struct GenericBufferView<Element> : ~Escapable {
164163
}
165164
}
166165

167-
// CHECK: sil hidden @$s28implicit_lifetime_dependence23tupleLifetimeDependenceyAA10BufferViewV_ADtADYliF : $@convention(thin) (@guaranteed BufferView) -> _inherit(0) (@owned BufferView, @owned BufferView) {
166+
// CHECK-LABEL: sil hidden @$s28implicit_lifetime_dependence23tupleLifetimeDependenceyAA10BufferViewV_ADtYliS_ADF : $@convention(thin) (@guaranteed BufferView) -> _inherit(0) (@owned BufferView, @owned BufferView) {
168167
func tupleLifetimeDependence(_ x: borrowing BufferView) -> (BufferView, BufferView) {
169168
return (BufferView(x.ptr, x.c), BufferView(x.ptr, x.c))
170169
}

test/SIL/lifetime_dependence_buffer_view_test.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,4 @@ public func array_view_element(a: ContiguousArray<Int> , i: BufferViewIndex<Int>
167167
public func array_view_slice_element(a: ContiguousArray<Int> , sliceIdx: FakeRange<BufferViewIndex<Int>>, Idx: BufferViewIndex<Int>) -> Int {
168168
a.view[sliceIdx][Idx]
169169
}
170+

test/SIL/lifetime_dependence_generics.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ public func test(pview: borrowing PView) -> dependsOn(pview) View {
2828
return pview.getDefault()
2929
}
3030

31-
// CHECK: sil hidden @$s28lifetime_dependence_generics1PPAAE10getDefault1EQzyYLsF : $@convention(method) <Self where Self : P> (@in_guaranteed Self) -> _scope(0) @out Self.E {
31+
// CHECK-LABEL: sil hidden @$s28lifetime_dependence_generics1PPAAE10getDefault1EQzYlsS_yF : $@convention(method) <Self where Self : P> (@in_guaranteed Self) -> _scope(0) @out Self.E {
3232

33-
// CHECK: sil hidden @$s28lifetime_dependence_generics5PViewV4getEAA4ViewVyYLsF : $@convention(method) (PView) -> _scope(0) @owned View {
33+
// CHECK-LABEL: sil hidden @$s28lifetime_dependence_generics5PViewV4getEAA4ViewVYlsS_yF : $@convention(method) (PView) -> _scope(0) @owned View {
3434

35-
// CHECK: sil private [transparent] [thunk] @$s28lifetime_dependence_generics5PViewVAA1PA2aDP4getE1EQzyYLsFTW : $@convention(witness_method: P) (@in_guaranteed PView) -> _scope(0) @out View {
35+
// CHECK-LABEL: sil private [transparent] [thunk] @$s28lifetime_dependence_generics5PViewVAA1PA2aDP4getE1EQzYlsS_yFTW : $@convention(witness_method: P) (@in_guaranteed PView) -> _scope(0) @out View {
3636

37-
// CHECK: sil @$s28lifetime_dependence_generics4test5pviewAA4ViewVAA5PViewVYls_tF : $@convention(thin) (PView) -> _scope(0) @owned View {
37+
// CHECK-LABEL: sil @$s28lifetime_dependence_generics4test5pviewAA4ViewVYlsS_AA5PViewV_tF : $@convention(thin) (PView) -> _scope(0) @owned View {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// RUN: %target-swift-frontend %s -emit-silgen \
2+
// RUN: -enable-experimental-feature NonescapableTypes
3+
4+
// REQUIRES: asserts
5+
// REQUIRES: swift_in_compiler
6+
7+
8+
public struct Span<Element> : ~Escapable {
9+
private var baseAddress: UnsafeRawPointer
10+
public let count: Int
11+
public init<Owner: ~Copyable & ~Escapable>(
12+
baseAddress: UnsafeRawPointer,
13+
count: Int,
14+
dependsOn owner: borrowing Owner
15+
) {
16+
self.init(
17+
baseAddress: baseAddress, count: count, dependsOn: owner
18+
)
19+
}
20+
}
21+
22+
extension ContiguousArray {
23+
public var span: Span<Element> {
24+
borrowing _read {
25+
yield Span(
26+
baseAddress: _baseAddressIfContiguous!, count: count, dependsOn: self
27+
)
28+
}
29+
}
30+
}
31+
32+
// CHECK-LABEL: sil hidden [ossa] @$s39lifetime_dependence_param_position_test11mayReassign4span2toyAA4SpanVySiGzYlsUS__s15ContiguousArrayVySiGtF : $@convention(thin) (@inout Span<Int>, @guaranteed ContiguousArray<Int>) -> _scope(1) () {
33+
func mayReassign(span: dependsOn(to) inout Span<Int>, to: ContiguousArray<Int>) {
34+
span = to.span
35+
}
36+

test/SILOptimizer/lifetime_dependence/lifetime_dependence_diagnostics.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,24 @@ func takeClosure(_: () -> ()) {}
6060

6161
// No mark_dependence is needed for a inherited scope.
6262
//
63-
// CHECK-LABEL: sil hidden @$s4test14bv_borrow_copyyAA2BVVADYlsF : $@convention(thin) (@guaranteed BV) -> _scope(0) @owned BV {
63+
// CHECK-LABEL: sil hidden @$s4test14bv_borrow_copyyAA2BVVYlsS_ADF : $@convention(thin) (@guaranteed BV) -> _scope(0) @owned BV {
6464
// CHECK: bb0(%0 : @noImplicitCopy $BV):
6565
// CHECK: apply %{{.*}}(%0) : $@convention(thin) (@guaranteed BV) -> _inherit(0) @owned BV
6666
// CHECK-NEXT: return %3 : $BV
67-
// CHECK-LABEL: } // end sil function '$s4test14bv_borrow_copyyAA2BVVADYlsF'
67+
// CHECK-LABEL: } // end sil function '$s4test14bv_borrow_copyyAA2BVVYlsS_ADF'
6868
func bv_borrow_copy(_ bv: borrowing BV) -> dependsOn(scoped bv) BV {
6969
bv_copy(bv)
7070
}
7171

7272
// The mark_dependence for the borrow scope should be marked
7373
// [nonescaping] after diagnostics.
7474
//
75-
// CHECK-LABEL: sil hidden @$s4test010bv_borrow_C00B0AA2BVVAEYls_tF : $@convention(thin) (@guaranteed BV) -> _scope(0) @owned BV {
75+
// CHECK-LABEL: sil hidden @$s4test010bv_borrow_C00B0AA2BVVYlsS_AE_tF : $@convention(thin) (@guaranteed BV) -> _scope(0) @owned BV {
7676
// CHECK: bb0(%0 : @noImplicitCopy $BV):
7777
// CHECK: [[R:%.*]] = apply %{{.*}}(%0) : $@convention(thin) (@guaranteed BV) -> _scope(0) @owned BV
7878
// CHECK: %{{.*}} = mark_dependence [nonescaping] [[R]] : $BV on %0 : $BV
7979
// CHECK-NEXT: return %{{.*}} : $BV
80-
// CHECK-LABEL: } // end sil function '$s4test010bv_borrow_C00B0AA2BVVAEYls_tF'
80+
// CHECK-LABEL: } // end sil function '$s4test010bv_borrow_C00B0AA2BVVYlsS_AE_tF'
8181
func bv_borrow_borrow(bv: borrowing BV) -> dependsOn(scoped bv) BV {
8282
bv_borrow_copy(bv)
8383
}
@@ -93,14 +93,14 @@ func neint_throws(ncInt: borrowing NCInt) throws -> NEInt {
9393
return NEInt(owner: ncInt)
9494
}
9595

96-
// CHECK-LABEL: sil hidden @$s4test9neint_try5ncIntAA5NEIntVAA5NCIntVYls_tKF : $@convention(thin) (@guaranteed NCInt) -> _scope(0) (@owned NEInt, @error any Error) {
96+
// CHECK-LABEL: sil hidden @$s4test9neint_try5ncIntAA5NEIntVYlsS_AA5NCIntV_tKF : $@convention(thin) (@guaranteed NCInt) -> _scope(0) (@owned NEInt, @error any Error) {
9797
// CHECK: try_apply %{{.*}}(%0) : $@convention(thin) (@guaranteed NCInt) -> _scope(0) (@owned NEInt, @error any Error), normal bb1, error bb2
9898
// CHECK: bb1([[R:%.*]] : $NEInt):
9999
// CHECK: [[MD:%.*]] = mark_dependence [nonescaping] %5 : $NEInt on %0 : $NCInt
100100
// CHECK: return [[MD]] : $NEInt
101101
// CHECK: bb2([[E:%.*]] : $any Error):
102102
// CHECK: throw [[E]] : $any Error
103-
// CHECK-LABEL: } // end sil function '$s4test9neint_try5ncIntAA5NEIntVAA5NCIntVYls_tKF'
103+
// CHECK-LABEL: } // end sil function '$s4test9neint_try5ncIntAA5NEIntVYlsS_AA5NCIntV_tKF'
104104
func neint_try(ncInt: borrowing NCInt) throws -> NEInt {
105105
try neint_throws(ncInt: ncInt)
106106
}

test/SILOptimizer/lifetime_dependence/lifetime_dependence_scope.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ struct NC : ~Copyable {
3333

3434
// Rewrite the mark_dependence to depend on the incoming argument rather than the nested access.
3535
//
36-
// CHECK-LABEL: sil hidden @$s4test13bv_get_mutate9containerAA2BVVAA2NCVzYls_tF : $@convention(thin) (@inout NC) -> _scope(0) @owned BV {
36+
// CHECK-LABEL: sil hidden @$s4test13bv_get_mutate9containerAA2BVVYlsS_AA2NCVz_tF : $@convention(thin) (@inout NC) -> _scope(0) @owned BV {
3737
// CHECK: bb0(%0 : $*NC):
3838
// CHECK: [[A:%.*]] = begin_access [read] [static] %0 : $*NC
3939
// CHECK: [[L:%.*]] = load [[A]] : $*NC
4040
// CHECK: [[R:%.*]] = apply %{{.*}}([[L]]) : $@convention(method) (@guaranteed NC) -> _scope(0) @owned BV
4141
// CHECK: [[M:%.*]] = mark_dependence [nonescaping] [[R]] : $BV on %0 : $*NC
42-
// CHECK-LABEL: } // end sil function '$s4test13bv_get_mutate9containerAA2BVVAA2NCVzYls_tF'
42+
// CHECK-LABEL: } // end sil function '$s4test13bv_get_mutate9containerAA2BVVYlsS_AA2NCVz_tF'
4343
func bv_get_mutate(container: inout NC) -> dependsOn(container) BV {
4444
container.getBV()
4545
}

0 commit comments

Comments
 (0)