|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: split-file %s %t |
| 3 | + |
| 4 | +/// Prepare the module imported as package, and two middle modules. |
| 5 | +// RUN: %target-swift-frontend -emit-module %t/PackageDep.swift -o %t |
| 6 | +// RUN: %target-swift-frontend -emit-module %t/ResilientDep.swift -o %t \ |
| 7 | +// RUN: -package-name MyPackage -I %t \ |
| 8 | +// RUN: -enable-library-evolution \ |
| 9 | +// RUN: -enable-experimental-feature AccessLevelOnImport |
| 10 | +// RUN: %target-swift-frontend -emit-module %t/NonResilientDep.swift -o %t \ |
| 11 | +// RUN: -package-name MyPackage -I %t \ |
| 12 | +// RUN: -enable-experimental-feature AccessLevelOnImport |
| 13 | + |
| 14 | +//--- PackageDep.swift |
| 15 | + |
| 16 | +//--- ResilientDep.swift |
| 17 | +package import PackageDep |
| 18 | + |
| 19 | +//--- NonResilientDep.swift |
| 20 | +package import PackageDep |
| 21 | + |
| 22 | +/// When the middle module is library-evolution enabled, the package import |
| 23 | +/// is only visible to modules from the same package. |
| 24 | +// RUN: %target-swift-frontend -typecheck %t/ResilientClient.swift \ |
| 25 | +// RUN: -package-name MyPackage -I %t \ |
| 26 | +// RUN: -enable-experimental-feature AccessLevelOnImport \ |
| 27 | +// RUN: -Rmodule-loading 2>&1 | %FileCheck -check-prefix=VISIBLE-PACKAGE-DEP %s |
| 28 | +// VISIBLE-PACKAGE-DEP: source: '{{.*}}PackageDep.swiftmodule' |
| 29 | + |
| 30 | +// RUN: %target-swift-frontend -typecheck %t/ResilientClient.swift \ |
| 31 | +// RUN: -package-name NotMyPackage -I %t \ |
| 32 | +// RUN: -enable-experimental-feature AccessLevelOnImport \ |
| 33 | +// RUN: -Rmodule-loading 2>&1 | %FileCheck -check-prefix=HIDDEN-PACKAGE-DEP %s |
| 34 | +// HIDDEN-PACKAGE-DEP-NOT: PackageDep |
| 35 | + |
| 36 | +//--- ResilientClient.swift |
| 37 | +import ResilientDep |
| 38 | + |
| 39 | +/// When the middle module isn't library-evolution enabled, all clients |
| 40 | +/// see the package dependency. |
| 41 | +// RUN: %target-swift-frontend -typecheck %t/NonResilientClient.swift \ |
| 42 | +// RUN: -package-name NotMyPackage -I %t \ |
| 43 | +// RUN: -enable-experimental-feature AccessLevelOnImport \ |
| 44 | +// RUN: -Rmodule-loading 2>&1 | %FileCheck -check-prefix=VISIBLE-PACKAGE-DEP %s |
| 45 | + |
| 46 | +//--- NonResilientClient.swift |
| 47 | +import NonResilientDep |
0 commit comments