|
1 | 1 | /// Check that only public imports are printed in modules interfaces,
|
2 | 2 | /// package imports and below are not.
|
| 3 | +// REQUIRES: asserts |
3 | 4 |
|
4 | 5 | // RUN: %empty-directory(%t)
|
5 | 6 | // RUN: split-file %s %t
|
|
28 | 29 | // RUN: %target-swift-typecheck-module-from-interface(%t/Client.private.swiftinterface) -I %t \
|
29 | 30 | // RUN: -module-name Client
|
30 | 31 |
|
31 |
| -// RUN: %FileCheck %s < %t/Client.swiftinterface |
32 |
| -// RUN: %FileCheck %s < %t/Client.private.swiftinterface |
| 32 | +// RUN: %FileCheck --check-prefixes=CHECK,CHECK-5 %s < %t/Client.swiftinterface |
| 33 | +// RUN: %FileCheck --check-prefixes=CHECK,CHECK-5 %s < %t/Client.private.swiftinterface |
33 | 34 |
|
34 | 35 | /// Build a client composed of many files.
|
35 | 36 | // RUN: %target-swift-frontend -typecheck %t/MultiFiles?.swift -I %t \
|
|
43 | 44 | // RUN: %target-swift-typecheck-module-from-interface(%t/MultiFiles.private.swiftinterface) -I %t \
|
44 | 45 | // RUN: -module-name MultiFiles
|
45 | 46 |
|
46 |
| -// RUN: %FileCheck %s < %t/MultiFiles.swiftinterface |
47 |
| -// RUN: %FileCheck %s < %t/MultiFiles.private.swiftinterface |
| 47 | +// RUN: %FileCheck --check-prefixes=CHECK,CHECK-5 %s < %t/MultiFiles.swiftinterface |
| 48 | +// RUN: %FileCheck --check-prefixes=CHECK,CHECK-5 %s < %t/MultiFiles.private.swiftinterface |
| 49 | + |
| 50 | +/// Swift 6 mode. |
| 51 | +// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \ |
| 52 | +// RUN: -package-name TestPackage -module-name Client_Swift6 \ |
| 53 | +// RUN: -enable-library-evolution -swift-version 6 \ |
| 54 | +// RUN: -emit-module-interface-path %t/Client_Swift6.swiftinterface \ |
| 55 | +// RUN: -emit-private-module-interface-path %t/Client_Swift6.private.swiftinterface |
| 56 | + |
| 57 | +// RUN: %target-swift-typecheck-module-from-interface(%t/Client_Swift6.swiftinterface) -I %t |
| 58 | +// RUN: %target-swift-typecheck-module-from-interface(%t/Client_Swift6.private.swiftinterface) -I %t \ |
| 59 | +// RUN: -module-name Client_Swift6 |
| 60 | + |
| 61 | +// RUN: %FileCheck %s --check-prefixes=CHECK,CHECK-6 < %t/Client_Swift6.swiftinterface |
| 62 | +// RUN: %FileCheck %s --check-prefixes=CHECK,CHECK-6 < %t/Client_Swift6.private.swiftinterface |
| 63 | + |
| 64 | +/// Feature flag. |
| 65 | +// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \ |
| 66 | +// RUN: -package-name TestPackage -module-name Client_FeatureFlag \ |
| 67 | +// RUN: -enable-library-evolution -swift-version 5 \ |
| 68 | +// RUN: -emit-module-interface-path %t/Client_FeatureFlag.swiftinterface \ |
| 69 | +// RUN: -emit-private-module-interface-path %t/Client_FeatureFlag.private.swiftinterface \ |
| 70 | +// RUN: -enable-upcoming-feature InternalImportsByDefault |
| 71 | + |
| 72 | +// RUN: %target-swift-typecheck-module-from-interface(%t/Client_FeatureFlag.swiftinterface) -I %t |
| 73 | +// RUN: %target-swift-typecheck-module-from-interface(%t/Client_FeatureFlag.private.swiftinterface) -I %t \ |
| 74 | +// RUN: -module-name Client_FeatureFlag |
| 75 | + |
| 76 | +// RUN: %FileCheck %s --check-prefixes=CHECK,CHECK-6,CHECK-FLAG < %t/Client_FeatureFlag.swiftinterface |
| 77 | +// RUN: %FileCheck %s --check-prefixes=CHECK,CHECK-6,CHECK-FLAG < %t/Client_FeatureFlag.private.swiftinterface |
48 | 78 |
|
49 | 79 | //--- PublicLib.swift
|
50 | 80 | //--- PackageLib.swift
|
|
53 | 83 | //--- PrivateLib.swift
|
54 | 84 |
|
55 | 85 | //--- Client.swift
|
| 86 | +// CHECK-5-NOT: public |
| 87 | +// CHECK-FLAG: -enable-upcoming-feature InternalImportsByDefault |
| 88 | +// CHECK-6: public |
| 89 | + |
56 | 90 | public import PublicLib
|
57 | 91 | // CHECK: PublicLib
|
58 | 92 |
|
|
0 commit comments