Skip to content

Commit 987a6c9

Browse files
committed
Add ~Escapable _read accessor test.
1 parent cf1a946 commit 987a6c9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

test/SILGen/accessor_borrow.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
// RUN: %target-swift-emit-silgen -module-name accessor_borrow -Xllvm -sil-full-demangle %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen -module-name accessor_borrow \
2+
// RUN: -enable-experimental-feature LifetimeDependence \
3+
// RUN: %s | %FileCheck %s
4+
5+
// REQUIRES: swift_feature_LifetimeDependence
26

37
struct NE: ~Escapable {}
48

59
struct NEContainer: ~Copyable {
610
// This accessor borrows self. Do not synthesize a getter.
11+
//
12+
// Check NEContainer.ne_coroutine.read
13+
// CHECK-LABEL: sil hidden [ossa] @$s15accessor_borrow11NEContainerV12ne_coroutineAA2NEVvr : $@yield_once @convention(method) (@guaranteed NEContainer) -> @lifetime(borrow 0) @yields @guaranteed NE {
14+
//
15+
// Do not synthesize NEContainer.ne_coroutine.getter
16+
// CHECK-NOT: $s15accessor_borrow11NEContainerV12ne_coroutineAA2NEVvg
717
var ne_coroutine: NE {
818
_read {
9-
NE()
19+
yield NE()
1020
}
1121
}
1222
}

0 commit comments

Comments
 (0)