|
11 | 11 |
|
12 | 12 | import CountedByNoEscapeClang |
13 | 13 |
|
14 | | -// CHECK: @lifetime(p: copy p) |
| 14 | +// CHECK: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
| 15 | +// CHECK-NEXT: @lifetime(p: copy p) |
15 | 16 | // CHECK-NEXT: @_alwaysEmitIntoClient public func complexExpr(_ len: Int32, _ offset: Int32, _ p: inout MutableSpan<Int32>) |
| 17 | +// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
16 | 18 | // CHECK-NEXT: @lifetime(p: copy p) |
17 | 19 | // CHECK-NEXT: @_alwaysEmitIntoClient public func nonnull(_ p: inout MutableSpan<Int32>) |
| 20 | +// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
18 | 21 | // CHECK-NEXT: @lifetime(p: copy p) |
19 | 22 | // CHECK-NEXT: @_alwaysEmitIntoClient public func nullUnspecified(_ p: inout MutableSpan<Int32>) |
| 23 | +// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
20 | 24 | // CHECK-NEXT: @lifetime(p: copy p) |
21 | 25 | // CHECK-NEXT: @_alwaysEmitIntoClient public func nullable(_ p: inout MutableSpan<Int32>?) |
| 26 | +// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
22 | 27 | // CHECK-NEXT: @lifetime(copy p) |
23 | 28 | // CHECK-NEXT: @lifetime(p: copy p) |
24 | 29 | // CHECK-NEXT: @_alwaysEmitIntoClient public func returnLifetimeBound(_ len1: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32> |
25 | 30 | // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func returnPointer(_ len: Int32) -> UnsafeMutableBufferPointer<Int32> |
| 31 | +// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
26 | 32 | // CHECK-NEXT: @lifetime(p1: copy p1) |
27 | 33 | // CHECK-NEXT: @lifetime(p2: copy p2) |
28 | 34 | // CHECK-NEXT: @_alwaysEmitIntoClient public func shared(_ len: Int32, _ p1: inout MutableSpan<Int32>, _ p2: inout MutableSpan<Int32>) |
| 35 | +// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
29 | 36 | // CHECK-NEXT: @lifetime(p: copy p) |
30 | 37 | // CHECK-NEXT: @_alwaysEmitIntoClient public func simple(_ p: inout MutableSpan<Int32>) |
| 38 | +// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
31 | 39 | // CHECK-NEXT: @lifetime(p: copy p) |
32 | 40 | // CHECK-NEXT: @_alwaysEmitIntoClient public func swiftAttr(_ p: inout MutableSpan<Int32>) |
33 | 41 |
|
| 42 | +@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
34 | 43 | @lifetime(p: copy p) |
35 | 44 | @inlinable |
36 | 45 | public func callComplexExpr(_ p: inout MutableSpan<CInt>) { |
37 | 46 | complexExpr(CInt(p.count), 1, &p) |
38 | 47 | } |
39 | 48 |
|
| 49 | +@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
40 | 50 | @lifetime(p: copy p) |
41 | 51 | @inlinable |
42 | 52 | public func callNonnull(_ p: inout MutableSpan<CInt>) { |
43 | 53 | nonnull(&p) |
44 | 54 | } |
45 | 55 |
|
| 56 | +@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
46 | 57 | @lifetime(p: copy p) |
47 | 58 | @inlinable |
48 | 59 | public func callNullUnspecified(_ p: inout MutableSpan<CInt>) { |
49 | 60 | nullUnspecified(&p) |
50 | 61 | } |
51 | 62 |
|
| 63 | +@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
52 | 64 | @lifetime(p: copy p) |
53 | 65 | @inlinable |
54 | 66 | public func callNullable(_ p: inout MutableSpan<CInt>?) { |
55 | 67 | nullable(&p) |
56 | 68 | } |
57 | 69 |
|
| 70 | +@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
58 | 71 | @lifetime(p: copy p) |
59 | 72 | @inlinable |
60 | 73 | public func callReturnLifetimeBound(_ p: inout MutableSpan<CInt>) { |
61 | 74 | let a: MutableSpan<CInt> = returnLifetimeBound(2, &p) |
62 | 75 | } |
63 | 76 |
|
| 77 | +@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
64 | 78 | @inlinable |
65 | 79 | public func callReturnPointer() { |
66 | 80 | let a: UnsafeMutableBufferPointer<CInt>? = returnPointer(4) // call wrapper |
67 | 81 | let b: UnsafeMutablePointer<CInt>? = returnPointer(4) // call unsafe interop |
68 | 82 | } |
69 | 83 |
|
| 84 | +@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
70 | 85 | @lifetime(p: copy p) |
71 | 86 | @lifetime(p2: copy p2) |
72 | 87 | @inlinable |
73 | 88 | public func callShared(_ p: inout MutableSpan<CInt>, _ p2: inout MutableSpan<CInt>) { |
74 | 89 | shared(CInt(p.count), &p, &p2) |
75 | 90 | } |
76 | 91 |
|
| 92 | +@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
77 | 93 | @lifetime(p: copy p) |
78 | 94 | @inlinable |
79 | 95 | public func callSimple(_ p: inout MutableSpan<CInt>) { |
80 | 96 | simple(&p) |
81 | 97 | } |
82 | 98 |
|
| 99 | +@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) |
83 | 100 | @lifetime(p: copy p) |
84 | 101 | @inlinable |
85 | 102 | public func callSwiftAttr(_ p: inout MutableSpan<CInt>) { |
|
0 commit comments