Skip to content

Commit bcdee6c

Browse files
committed
[NFC] Update tests and diagnostics
1 parent d7466e8 commit bcdee6c

File tree

82 files changed

+1133
-942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1133
-942
lines changed

test/ASTGen/attrs.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// RUN: %target-swift-frontend-dump-parse \
44
// RUN: -enable-experimental-feature Extern \
5-
// RUN: -enable-experimental-feature LifetimeDependence \
5+
// RUN: -enable-experimental-feature Lifetimes \
66
// RUN: -enable-experimental-feature RawLayout \
77
// RUN: -enable-experimental-feature SymbolLinkageMarkers \
88
// RUN: -enable-experimental-concurrency \
@@ -12,7 +12,7 @@
1212

1313
// RUN: %target-swift-frontend-dump-parse \
1414
// RUN: -enable-experimental-feature Extern \
15-
// RUN: -enable-experimental-feature LifetimeDependence \
15+
// RUN: -enable-experimental-feature Lifetimes \
1616
// RUN: -enable-experimental-feature RawLayout \
1717
// RUN: -enable-experimental-feature SymbolLinkageMarkers \
1818
// RUN: -enable-experimental-concurrency \
@@ -25,7 +25,7 @@
2525
// RUN: -module-abi-name ASTGen \
2626
// RUN: -enable-experimental-feature ParserASTGen \
2727
// RUN: -enable-experimental-feature Extern \
28-
// RUN: -enable-experimental-feature LifetimeDependence \
28+
// RUN: -enable-experimental-feature Lifetimes \
2929
// RUN: -enable-experimental-feature RawLayout \
3030
// RUN: -enable-experimental-feature SymbolLinkageMarkers \
3131
// RUN: -enable-experimental-concurrency \
@@ -36,7 +36,7 @@
3636
// REQUIRES: swift_swift_parser
3737
// REQUIRES: swift_feature_ParserASTGen
3838
// REQUIRES: swift_feature_Extern
39-
// REQUIRES: swift_feature_LifetimeDependence
39+
// REQUIRES: swift_feature_Lifetimes
4040
// REQUIRES: swift_feature_RawLayout
4141
// REQUIRES: swift_feature_SymbolLinkageMarkers
4242

@@ -211,13 +211,13 @@ struct OpTest {
211211

212212
struct E {}
213213
struct NE : ~Escapable {}
214-
@lifetime(copy ne) func derive(_ ne: NE) -> NE { ne }
215-
@lifetime(borrow ne1, copy ne2) func derive(_ ne1: NE, _ ne2: NE) -> NE {
214+
@_lifetime(copy ne) func derive(_ ne: NE) -> NE { ne }
215+
@_lifetime(borrow ne1, copy ne2) func derive(_ ne1: NE, _ ne2: NE) -> NE {
216216
if (Int.random(in: 1..<100) < 50) { return ne1 }
217217
return ne2
218218
}
219-
@lifetime(borrow borrow) func testNameConflict(_ borrow: E) -> NE { NE() }
220-
@lifetime(result: copy source) func testTarget(_ result: inout NE, _ source: consuming NE) { result = source }
219+
@_lifetime(borrow borrow) func testNameConflict(_ borrow: E) -> NE { NE() }
220+
@_lifetime(result: copy source) func testTarget(_ result: inout NE, _ source: consuming NE) { result = source }
221221

222222
actor MyActor {
223223
nonisolated let constFlag: Bool = false

test/Generics/inverse_generics.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %target-typecheck-verify-swift \
2-
// RUN: -enable-experimental-feature LifetimeDependence \
2+
// RUN: -enable-experimental-feature Lifetimes \
33
// RUN: -enable-experimental-feature SuppressedAssociatedTypes
44

5-
// REQUIRES: swift_feature_LifetimeDependence
5+
// REQUIRES: swift_feature_Lifetimes
66
// REQUIRES: swift_feature_SuppressedAssociatedTypes
77

88
// expected-note@+1 {{'T' has '~Copyable' constraint preventing implicit 'Copyable' conformance}}
@@ -249,7 +249,7 @@ struct BuggerView<T: ~Copyable>: ~Escapable, Copyable {}
249249

250250
struct MutableBuggerView<T: ~Copyable>: ~Copyable, ~Escapable {}
251251

252-
@lifetime(mutRef: copy mutRef)
252+
@_lifetime(mutRef: copy mutRef)
253253
func checkNominals(_ mutRef: inout MutableBuggerView<NC>,
254254
_ ref: BuggerView<NC>,
255255
_ intMutRef: borrowing MutableBuggerView<Int>,

test/IRGen/addressable.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
// RUN: %target-swift-frontend -module-name A -emit-ir -primary-file %s \
2-
// RUN: -enable-experimental-feature LifetimeDependence \
2+
// RUN: -enable-experimental-feature Lifetimes \
33
// RUN: -enable-experimental-feature AddressableTypes \
44
// RUN: | %FileCheck %s
55

66
// REQUIRES: swift_feature_AddressableTypes
7-
// REQUIRES: swift_feature_LifetimeDependence
7+
// REQUIRES: swift_feature_Lifetimes
88

99
public struct NE: ~Escapable {}
1010

1111
@_addressableForDependencies
1212
public struct Holder {}
1313

1414
@_silgen_name("holder_NE")
15-
@lifetime(borrow holder)
15+
@_lifetime(borrow holder)
1616
func getNE(_ holder: Holder) -> NE
1717

1818
@_silgen_name("holder_mut_NE")
19-
@lifetime(&holder)
19+
@_lifetime(&holder)
2020
func getMutNE(_ holder: inout Holder) -> NE
2121

2222
// The parameter cannot be 'nocapture'.

test/Interop/C/swiftify-import/counted-by-lifetimebound.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
// REQUIRES: swift_feature_SafeInteropWrappers
2-
// REQUIRES: swift_feature_LifetimeDependence
2+
// REQUIRES: swift_feature_Lifetimes
33

44
// 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 | %FileCheck %s
55

66
// swift-ide-test doesn't currently typecheck the macro expansions, so run the compiler as well
77
// 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 %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
99

1010
// Check that ClangImporter correctly infers and expands @_SwiftifyImport macros for functions with __sized_by __lifetimebound parameters and return values.
1111

1212
import CountedByLifetimeboundClang
1313

1414
// CHECK: /// This is an auto-generated wrapper for safer interop
1515
// 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)
1818
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func complexExpr(_ len: Int32, _ offset: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
1919

2020
// CHECK: /// This is an auto-generated wrapper for safer interop
2121
// 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)
2424
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func constant(_ p: inout MutableSpan<Int32>?) -> MutableSpan<Int32>?
2525

2626
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
2727
// 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)
2929
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func noncountedLifetime(_ len: Int32, _ p: UnsafeMutablePointer<Int32>!) -> MutableSpan<Int32>
3030

3131
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
3232
// 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)
3535
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nonnull(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
3636

3737
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
3838
// 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)
4141
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullUnspecified(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
4242

4343
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
4444
// 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)
4747
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullable(_ len: Int32, _ p: inout MutableSpan<Int32>?) -> MutableSpan<Int32>?
4848

4949
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
5050
// 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)
5353
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func shared(_ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
5454

5555
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
5656
// 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)
5959
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func simple(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
6060

6161

0 commit comments

Comments
 (0)