|
1 | 1 | // REQUIRES: swift_feature_SafeInteropWrappers |
2 | | -// REQUIRES: swift_feature_LifetimeDependence |
| 2 | +// REQUIRES: swift_feature_Lifetimes |
3 | 3 |
|
4 | 4 | // RUN: %target-swift-ide-test -print-module -module-to-print=CountedByLifetimeboundClang -plugin-path %swift-plugin-dir -I %S/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers -Xcc -Wno-nullability-completeness | %FileCheck %s |
5 | 5 |
|
6 | 6 | // swift-ide-test doesn't currently typecheck the macro expansions, so run the compiler as well |
7 | 7 | // RUN: %empty-directory(%t) |
8 | | -// RUN: %target-swift-frontend -emit-module -plugin-path %swift-plugin-dir -o %t/CountedByLifetimebound.swiftmodule -I %S/Inputs -enable-experimental-feature SafeInteropWrappers -enable-experimental-feature LifetimeDependence -strict-memory-safety -warnings-as-errors -Xcc -Werror -Xcc -Wno-nullability-completeness %s |
| 8 | +// RUN: %target-swift-frontend -emit-module -plugin-path %swift-plugin-dir -o %t/CountedByLifetimebound.swiftmodule -I %S/Inputs -enable-experimental-feature SafeInteropWrappers -enable-experimental-feature Lifetimes %s |
9 | 9 |
|
10 | 10 | // Check that ClangImporter correctly infers and expands @_SwiftifyImport macros for functions with __sized_by __lifetimebound parameters and return values. |
11 | 11 |
|
12 | 12 | import CountedByLifetimeboundClang |
13 | 13 |
|
14 | 14 | // CHECK: /// This is an auto-generated wrapper for safer interop |
15 | 15 | // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
16 | | -// CHECK-NEXT: @lifetime(copy p) |
17 | | -// CHECK-NEXT: @lifetime(p: copy p) |
| 16 | +// CHECK-NEXT: @_lifetime(copy p) |
| 17 | +// CHECK-NEXT: @_lifetime(p: copy p) |
18 | 18 | // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func complexExpr(_ len: Int32, _ offset: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32> |
19 | 19 |
|
20 | 20 | // CHECK: /// This is an auto-generated wrapper for safer interop |
21 | 21 | // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
22 | | -// CHECK-NEXT: @lifetime(copy p) |
23 | | -// CHECK-NEXT: @lifetime(p: copy p) |
| 22 | +// CHECK-NEXT: @_lifetime(copy p) |
| 23 | +// CHECK-NEXT: @_lifetime(p: copy p) |
24 | 24 | // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func constant(_ p: inout MutableSpan<Int32>?) -> MutableSpan<Int32>? |
25 | 25 |
|
26 | 26 | // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop |
27 | 27 | // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
28 | | -// CHECK-NEXT: @lifetime(borrow p) |
| 28 | +// CHECK-NEXT: @_lifetime(borrow p) |
29 | 29 | // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func noncountedLifetime(_ len: Int32, _ p: UnsafeMutablePointer<Int32>!) -> MutableSpan<Int32> |
30 | 30 |
|
31 | 31 | // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop |
32 | 32 | // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
33 | | -// CHECK-NEXT: @lifetime(copy p) |
34 | | -// CHECK-NEXT: @lifetime(p: copy p) |
| 33 | +// CHECK-NEXT: @_lifetime(copy p) |
| 34 | +// CHECK-NEXT: @_lifetime(p: copy p) |
35 | 35 | // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nonnull(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32> |
36 | 36 |
|
37 | 37 | // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop |
38 | 38 | // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
39 | | -// CHECK-NEXT: @lifetime(copy p) |
40 | | -// CHECK-NEXT: @lifetime(p: copy p) |
| 39 | +// CHECK-NEXT: @_lifetime(copy p) |
| 40 | +// CHECK-NEXT: @_lifetime(p: copy p) |
41 | 41 | // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullUnspecified(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32> |
42 | 42 |
|
43 | 43 | // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop |
44 | 44 | // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
45 | | -// CHECK-NEXT: @lifetime(copy p) |
46 | | -// CHECK-NEXT: @lifetime(p: copy p) |
| 45 | +// CHECK-NEXT: @_lifetime(copy p) |
| 46 | +// CHECK-NEXT: @_lifetime(p: copy p) |
47 | 47 | // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullable(_ len: Int32, _ p: inout MutableSpan<Int32>?) -> MutableSpan<Int32>? |
48 | 48 |
|
49 | 49 | // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop |
50 | 50 | // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
51 | | -// CHECK-NEXT: @lifetime(copy p) |
52 | | -// CHECK-NEXT: @lifetime(p: copy p) |
| 51 | +// CHECK-NEXT: @_lifetime(copy p) |
| 52 | +// CHECK-NEXT: @_lifetime(p: copy p) |
53 | 53 | // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func shared(_ p: inout MutableSpan<Int32>) -> MutableSpan<Int32> |
54 | 54 |
|
55 | 55 | // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop |
56 | 56 | // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
57 | | -// CHECK-NEXT: @lifetime(copy p) |
58 | | -// CHECK-NEXT: @lifetime(p: copy p) |
| 57 | +// CHECK-NEXT: @_lifetime(copy p) |
| 58 | +// CHECK-NEXT: @_lifetime(p: copy p) |
59 | 59 | // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func simple(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32> |
60 | 60 |
|
61 | 61 |
|
|
0 commit comments