|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | + |
| 3 | +// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -emit-module \ |
| 4 | +// RUN: -disable-experimental-parser-round-trip \ |
| 5 | +// RUN: -enable-experimental-feature NoncopyableGenerics \ |
| 6 | +// RUN: -enable-experimental-feature NonescapableTypes \ |
| 7 | +// RUN: -o %t/lifetime_dependence.swiftmodule \ |
| 8 | +// RUN: -emit-module-interface-path %t/lifetime_dependence.swiftinterface \ |
| 9 | +// RUN: %S/Inputs/lifetime_dependence.swift |
| 10 | +// REQUIRES: asserts |
| 11 | + |
| 12 | +// Check the interfaces |
| 13 | + |
| 14 | +// RUN: %FileCheck %s < %t/lifetime_dependence.swiftinterface |
| 15 | + |
| 16 | +// See if we can compile a module through just the interface and typecheck using it. |
| 17 | + |
| 18 | +// RUN: %target-swift-frontend -compile-module-from-interface \ |
| 19 | +// RUN: -disable-experimental-parser-round-trip \ |
| 20 | +// RUN: -enable-experimental-feature NoncopyableGenerics \ |
| 21 | +// RUN: -enable-experimental-feature NonescapableTypes \ |
| 22 | +// RUN: %t/lifetime_dependence.swiftinterface -o %t/lifetime_dependence.swiftmodule |
| 23 | + |
| 24 | +// RUN: %target-swift-frontend -typecheck -I %t %s \ |
| 25 | +// RUN: -disable-experimental-parser-round-trip \ |
| 26 | +// RUN: -enable-experimental-feature NoncopyableGenerics \ |
| 27 | +// RUN: -enable-experimental-feature NonescapableTypes |
| 28 | + |
| 29 | +import lifetime_dependence |
| 30 | + |
| 31 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 32 | +// CHECK: @inlinable internal init(_ ptr: Swift.UnsafeRawBufferPointer, _ a: borrowing Swift.Array<Swift.Int>) -> _borrow(a) Self { |
| 33 | +// CHECK: @inlinable internal init(_ ptr: Swift.UnsafeRawBufferPointer, _ a: consuming lifetime_dependence.AnotherView) -> _consume(a) Self { |
| 34 | +// CHECK: #endif |
| 35 | + |
| 36 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 37 | +// CHECK: @inlinable public func derive(_ x: consuming lifetime_dependence.BufferView) -> _consume(x) lifetime_dependence.BufferView { |
| 38 | +// CHECK: #endif |
| 39 | + |
| 40 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 41 | +// CHECK: @inlinable public func consumeAndCreate(_ view: consuming lifetime_dependence.BufferView) -> _consume(view) lifetime_dependence.BufferView { |
| 42 | +// CHECK: #endif |
| 43 | + |
| 44 | +// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
| 45 | +// CHECK: @inlinable public func deriveThisOrThat(_ this: consuming lifetime_dependence.BufferView, _ that: consuming lifetime_dependence.BufferView) -> _consume(this) _consume(that) lifetime_dependence.BufferView { |
| 46 | +// CHECK: #endif |
0 commit comments