Skip to content

Commit d221c13

Browse files
committed
[Tests] Update tests using @_implementationOnly imports to use library-evolution
1 parent fabb345 commit d221c13

12 files changed

+68
-25
lines changed

test/Concurrency/preconcurrency_implementationonly_override.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/ImplementationOnlyDefs.swiftmodule -module-name ImplementationOnlyDefs %S/Inputs/ImplementationOnlyDefs.swift
3-
// RUN: %target-typecheck-verify-swift -disable-availability-checking -I %t
2+
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/ImplementationOnlyDefs.swiftmodule -module-name ImplementationOnlyDefs %S/Inputs/ImplementationOnlyDefs.swift \
3+
// RUN: -enable-library-evolution -swift-version 5
4+
// RUN: %target-typecheck-verify-swift -disable-availability-checking -I %t \
5+
// RUN: -enable-library-evolution -swift-version 5
46

57
// REQUIRES: concurrency
68

test/SPI/implementation_only_spi_import_exposability.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/// @_implementationOnly imported decls (SPI or not) should not be exposed in SPI.
22

33
// RUN: %empty-directory(%t)
4-
// RUN: %target-swift-frontend -emit-module -DLIB %s -module-name Lib -emit-module-path %t/Lib.swiftmodule
5-
// RUN: %target-typecheck-verify-swift -DCLIENT -I %t
4+
// RUN: %target-swift-frontend -emit-module -DLIB %s -module-name Lib -emit-module-path %t/Lib.swiftmodule \
5+
// RUN: -swift-version 5 -enable-library-evolution
6+
// RUN: %target-typecheck-verify-swift -DCLIENT -I %t \
7+
// RUN: -swift-version 5 -enable-library-evolution
68

79
#if LIB
810

test/SPI/report-ioi-in-spi.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22
// RUN: split-file %s %t
33

44
// RUN: %target-swift-frontend -emit-module %t/Lib.swift -I %t \
5+
// RUN: -enable-library-evolution \
56
// RUN: -module-name Lib -emit-module-path %t/Lib.swiftmodule \
67
// RUN: -swift-version 5
78

89
/// Use of IOI types in SPI signatures is an error with -experimental-spi-only-imports
910
// RUN: %target-swift-frontend -emit-module %t/ClientSPIOnlyMode.swift -I %t \
11+
// RUN: -enable-library-evolution \
1012
// RUN: -swift-version 5 -verify \
1113
// RUN: -experimental-spi-only-imports
1214

1315
/// Use of IOI types in SPI signatures is a warning without -experimental-spi-only-imports
1416
// RUN: %target-swift-frontend -emit-module %t/ClientDefaultMode.swift -I %t \
17+
// RUN: -enable-library-evolution \
1518
// RUN: -swift-version 5 -verify
1619

1720
/// This is a warning in swiftinterfaces
1821
// R UN: %target-swift-typecheck-module-from-interface(%t/Client.private.swiftinterface) \
22+
// RUN: -enable-library-evolution \
1923
// R UN: -I %t -module-name Client
2024

2125
//--- Lib.swift

test/SPI/spi-only-import-conflicting.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,29 @@
1010

1111
/// Build clients.
1212
// RUN: %target-swift-frontend -typecheck %t/SPIOnly_Default.swift -I %t -verify \
13+
// RUN: -swift-version 5 -enable-library-evolution \
1314
// RUN: -experimental-spi-only-imports -verify
1415
// RUN: %target-swift-frontend -typecheck %t/Default_SPIOnly.swift -I %t -verify \
16+
// RUN: -swift-version 5 -enable-library-evolution \
1517
// RUN: -experimental-spi-only-imports -verify
1618
// RUN: %target-swift-frontend -typecheck %t/SPIOnly_Exported.swift -I %t -verify \
19+
// RUN: -swift-version 5 -enable-library-evolution \
1720
// RUN: -experimental-spi-only-imports -verify
1821
// RUN: %target-swift-frontend -typecheck %t/Exported_SPIOnly.swift -I %t -verify \
22+
// RUN: -swift-version 5 -enable-library-evolution \
1923
// RUN: -experimental-spi-only-imports -verify
2024
// RUN: %target-swift-frontend -typecheck %t/SPIOnly_IOI.swift -I %t -verify \
25+
// RUN: -swift-version 5 -enable-library-evolution \
2126
// RUN: -experimental-spi-only-imports -verify
2227
// RUN: %target-swift-frontend -typecheck %t/SPIOnly_IOI_Exported_Default.swift -I %t -verify \
28+
// RUN: -swift-version 5 -enable-library-evolution \
2329
// RUN: -experimental-spi-only-imports -verify
2430
// RUN: %target-swift-frontend -typecheck -primary-file %t/SPIOnly_Default_FileA.swift \
31+
// RUN: -swift-version 5 -enable-library-evolution \
2532
// RUN: %t/SPIOnly_Default_FileB.swift -I %t -verify \
2633
// RUN: -experimental-spi-only-imports -verify
2734
// RUN: %target-swift-frontend -typecheck -primary-file %t/IOI_Default_FileA.swift \
35+
// RUN: -swift-version 5 -enable-library-evolution \
2836
// RUN: %t/IOI_Default_FileB.swift -I %t -verify \
2937
// RUN: -experimental-spi-only-imports -verify
3038

test/Sema/implementation-only-import-in-decls.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -o %t/NormalLibrary.swiftmodule %S/Inputs/implementation-only-import-in-decls-public-helper.swift
3-
// RUN: %target-swift-frontend -emit-module -o %t/BADLibrary.swiftmodule %S/Inputs/implementation-only-import-in-decls-helper.swift -I %t
2+
// RUN: %target-swift-frontend -emit-module -o %t/NormalLibrary.swiftmodule %S/Inputs/implementation-only-import-in-decls-public-helper.swift \
3+
// RUN: -enable-library-evolution -swift-version 5
4+
// RUN: %target-swift-frontend -emit-module -o %t/BADLibrary.swiftmodule %S/Inputs/implementation-only-import-in-decls-helper.swift -I %t \
5+
// RUN: -enable-library-evolution -swift-version 5
46

5-
// RUN: %target-typecheck-verify-swift -I %t
7+
// RUN: %target-typecheck-verify-swift -I %t \
8+
// RUN: -enable-library-evolution -swift-version 5
69

710
import NormalLibrary
811
@_implementationOnly import BADLibrary

test/Sema/implementation-only-import-inlinable-conformances.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -o %t/NormalLibrary.swiftmodule %S/Inputs/implementation-only-import-in-decls-public-helper.swift
3-
// RUN: %target-swift-frontend -emit-module -o %t/BADLibrary.swiftmodule %S/Inputs/implementation-only-import-in-decls-helper.swift -I %t
2+
// RUN: %target-swift-frontend -emit-module -o %t/NormalLibrary.swiftmodule %S/Inputs/implementation-only-import-in-decls-public-helper.swift \
3+
// RUN: -enable-library-evolution -swift-version 5
4+
// RUN: %target-swift-frontend -emit-module -o %t/BADLibrary.swiftmodule %S/Inputs/implementation-only-import-in-decls-helper.swift -I %t \
5+
// RUN: -enable-library-evolution -swift-version 5
46

5-
// RUN: %target-typecheck-verify-swift -I %t
7+
// RUN: %target-typecheck-verify-swift -I %t -enable-library-evolution -swift-version 5
68

79
@_implementationOnly import BADLibrary
810
import NormalLibrary

test/Sema/implementation-only-import-inlinable-indirect.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -o %t/indirects.swiftmodule %S/Inputs/implementation-only-imports/indirects.swift
3-
// RUN: %target-swift-frontend -emit-module -o %t/directs.swiftmodule -I %t %S/Inputs/implementation-only-imports/directs.swift
2+
// RUN: %target-swift-frontend -emit-module -o %t/indirects.swiftmodule %S/Inputs/implementation-only-imports/indirects.swift \
3+
// RUN: -enable-library-evolution -swift-version 5
4+
// RUN: %target-swift-frontend -emit-module -o %t/directs.swiftmodule -I %t %S/Inputs/implementation-only-imports/directs.swift \
5+
// RUN: -enable-library-evolution -swift-version 5
46

5-
// RUN: %target-swift-frontend -typecheck -verify %s -I %t
7+
// RUN: %target-swift-frontend -typecheck -verify %s -I %t \
8+
// RUN: -enable-library-evolution -swift-version 5
69

710
@_implementationOnly import directs
811

test/Sema/implementation-only-import-inlinable-multifile.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -o %t/indirects.swiftmodule %S/Inputs/implementation-only-imports/indirects.swift
3-
// RUN: %target-swift-frontend -emit-module -o %t/directs.swiftmodule -I %t %S/Inputs/implementation-only-imports/directs.swift
2+
// RUN: %target-swift-frontend -emit-module -o %t/indirects.swiftmodule %S/Inputs/implementation-only-imports/indirects.swift \
3+
// RUN: -enable-library-evolution -swift-version 5
4+
// RUN: %target-swift-frontend -emit-module -o %t/directs.swiftmodule -I %t %S/Inputs/implementation-only-imports/directs.swift \
5+
// RUN: -enable-library-evolution -swift-version 5
46

5-
// RUN: %target-swift-frontend -typecheck -verify -primary-file %s %S/Inputs/implementation-only-imports/secondary_file.swift -I %t
7+
// RUN: %target-swift-frontend -typecheck -verify -primary-file %s %S/Inputs/implementation-only-imports/secondary_file.swift -I %t \
8+
// RUN: -enable-library-evolution -swift-version 5
69

710
@_implementationOnly import directs
811
// 'indirects' is imported for re-export in a secondary file

test/Sema/implementation-only-import-inlinable.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -emit-module -o %t/indirects.swiftmodule %S/Inputs/implementation-only-imports/indirects.swift
3-
// RUN: %target-swift-frontend -emit-module -o %t/directs.swiftmodule -I %t %S/Inputs/implementation-only-imports/directs.swift
2+
// RUN: %target-swift-frontend -emit-module -o %t/indirects.swiftmodule %S/Inputs/implementation-only-imports/indirects.swift \
3+
// RUN: -enable-library-evolution -swift-version 5
4+
// RUN: %target-swift-frontend -emit-module -o %t/directs.swiftmodule -I %t %S/Inputs/implementation-only-imports/directs.swift \
5+
// RUN: -enable-library-evolution -swift-version 5
46

5-
// RUN: %target-swift-frontend -typecheck -verify %s -I %t
7+
// RUN: %target-swift-frontend -typecheck -verify %s -I %t \
8+
// RUN: -enable-library-evolution -swift-version 5
69

710
@_implementationOnly import directs
811
import indirects

test/Sema/missing-import-inlinable-code.swift

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@
33
// RUN: %empty-directory(%t)
44
// RUN: %{python} %utils/split_file.py -o %t %s
55

6-
// RUN: %target-swift-frontend -emit-module %t/empty.swift -module-name empty -o %t/empty.swiftmodule
7-
// RUN: %target-swift-frontend -emit-module %t/libA.swift -module-name libA -o %t/libA.swiftmodule
8-
// RUN: %target-swift-frontend -emit-module %t/libB.swift -module-name libB -o %t/libB.swiftmodule -I %t
6+
// RUN: %target-swift-frontend -emit-module %t/empty.swift -module-name empty -o %t/empty.swiftmodule \
7+
// RUN: -enable-library-evolution
8+
// RUN: %target-swift-frontend -emit-module %t/libA.swift -module-name libA -o %t/libA.swiftmodule \
9+
// RUN: -enable-library-evolution
10+
// RUN: %target-swift-frontend -emit-module %t/libB.swift -module-name libB -o %t/libB.swiftmodule -I %t \
11+
// RUN: -enable-library-evolution
912

1013
/// In pre-Swift 6, this is a warning where there's no implementation-only import present.
11-
// RUN: %target-swift-frontend -emit-module %t/clientFileA-Swift5.swift %t/clientFileB.swift -module-name client -o %t/client.swiftmodule -I %t -verify
14+
// RUN: %target-swift-frontend -emit-module %t/clientFileA-Swift5.swift %t/clientFileB.swift -module-name client -o %t/client.swiftmodule -I %t -verify \
15+
// RUN: -enable-library-evolution
1216

1317
/// In pre-Swift 6, this remains an error when there's an implementation-only import present.
14-
// RUN: %target-swift-frontend -emit-module %t/clientFileA-OldCheck.swift %t/clientFileB.swift -module-name client -o %t/client.swiftmodule -I %t -verify
18+
// RUN: %target-swift-frontend -emit-module %t/clientFileA-OldCheck.swift %t/clientFileB.swift -module-name client -o %t/client.swiftmodule -I %t -verify \
19+
// RUN: -enable-library-evolution
1520

1621
/// In Swift 6, it's an error.
17-
// RUN: %target-swift-frontend -emit-module %t/clientFileA-Swift6.swift %t/clientFileB.swift -module-name client -o %t/client.swiftmodule -I %t -verify -swift-version 6
22+
// RUN: %target-swift-frontend -emit-module %t/clientFileA-Swift6.swift %t/clientFileB.swift -module-name client -o %t/client.swiftmodule -I %t -verify -swift-version 6 \
23+
// RUN: -enable-library-evolution
1824

1925
/// The swiftinterface is broken by the missing import without the workaround.
2026
// RUN: %target-swift-emit-module-interface(%t/ClientBroken.swiftinterface) %t/clientFileA-Swift5.swift %t/clientFileB.swift -I %t -disable-print-missing-imports-in-module-interface

test/Sema/restricted-imports-priorities.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,22 @@
1616
// RUN: -swift-version 5 -enable-library-evolution -I %t
1717

1818
// RUN: %target-swift-frontend -typecheck %t/TwoIOI.swift -I %t -verify \
19+
// RUN: -swift-version 5 -enable-library-evolution \
1920
// RUN: -experimental-spi-only-imports -verify
2021
// RUN: %target-swift-frontend -typecheck %t/SPIOnlyAndIOI1.swift -I %t -verify \
22+
// RUN: -swift-version 5 -enable-library-evolution \
2123
// RUN: -experimental-spi-only-imports -verify
2224
// RUN: %target-swift-frontend -typecheck %t/SPIOnlyAndIOI2.swift -I %t -verify \
25+
// RUN: -swift-version 5 -enable-library-evolution \
2326
// RUN: -experimental-spi-only-imports -verify
2427
// RUN: %target-swift-frontend -typecheck %t/TwoSPIOnly.swift -I %t -verify \
28+
// RUN: -swift-version 5 -enable-library-evolution \
2529
// RUN: -experimental-spi-only-imports -verify
2630
// RUN: %target-swift-frontend -typecheck %t/OneSPIOnly1.swift -I %t -verify \
31+
// RUN: -swift-version 5 -enable-library-evolution \
2732
// RUN: -experimental-spi-only-imports -verify
2833
// RUN: %target-swift-frontend -typecheck %t/OneSPIOnly2.swift -I %t -verify \
34+
// RUN: -swift-version 5 -enable-library-evolution \
2935
// RUN: -experimental-spi-only-imports -verify
3036

3137
/// Setup 2 indirect imports of LibA, allowing the same LibA to be imported

test/decl/import/import.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@ import func français.phoûx
7474
import main // expected-warning {{file 'import.swift' is part of module 'main'; ignoring import}}
7575

7676
@_exported @_implementationOnly import empty // expected-error {{module 'empty' cannot be both exported and implementation-only}} {{12-33=}}
77+
// expected-warning @-1 {{using '@_implementationOnly' without enabling library evolution for 'main' may lead to instability during execution}}

0 commit comments

Comments
 (0)