mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
8847c38bf2
These changes are not required for the tests to pass but the tests now properly express the original intention, which was to test conditionally Escapable types.
39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
// RUN: %target-sil-opt \
|
|
// RUN: %s \
|
|
// RUN: -enable-experimental-feature Lifetimes \
|
|
// RUN: | \
|
|
// RUN: %target-sil-opt \
|
|
// RUN: -enable-experimental-feature Lifetimes \
|
|
// RUN: | \
|
|
// RUN: %FileCheck %s
|
|
|
|
// REQUIRES: swift_feature_Lifetimes
|
|
|
|
// For -enable-experimental-feature Lifetimes
|
|
|
|
// TODO: Once NoncopyableGenerics/NonescapableTypes is no longer behind a feature flag, merge this into basic2.
|
|
|
|
sil_stage raw
|
|
|
|
import Swift
|
|
|
|
// CHECK-LABEL: struct NCG<T> : ~Copyable {
|
|
// CHECK-NEXT: var t: T
|
|
// CHECK-NEXT: deinit
|
|
struct NCG<T> : ~Copyable {
|
|
var t: T
|
|
deinit
|
|
}
|
|
|
|
// CHECK-LABEL: struct NEG<T> : ~Escapable where T : ~Escapable {
|
|
// CHECK-NEXT: var t: T
|
|
struct NEG<T : ~Escapable> : ~Escapable {
|
|
var t: T
|
|
@_lifetime(copy t)
|
|
init(_ t: consuming T) {
|
|
self.t = t
|
|
}
|
|
}
|
|
|
|
extension NEG: Escapable where T: Escapable {}
|