|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: split-file %s %t |
| 3 | + |
| 4 | +/// Build the libraries. |
| 5 | +// RUN: %target-swift-frontend -emit-module %t/DefaultLib.swift -o %t |
| 6 | +// RUN: %target-swift-frontend -emit-module %t/PublicLib.swift -o %t |
| 7 | +// RUN: %target-swift-frontend -emit-module %t/PackageLib.swift -o %t |
| 8 | +// RUN: %target-swift-frontend -emit-module %t/InternalLib.swift -o %t |
| 9 | +// RUN: %target-swift-frontend -emit-module %t/FileprivateLib.swift -o %t |
| 10 | +// RUN: %target-swift-frontend -emit-module %t/PrivateLib.swift -o %t |
| 11 | + |
| 12 | +/// A resilient client will error on public imports. |
| 13 | +// RUN: %target-swift-frontend -typecheck %t/Client_Swift5.swift -I %t \ |
| 14 | +// RUN: -enable-library-evolution -swift-version 5 \ |
| 15 | +// RUN: -enable-experimental-feature AccessLevelOnImport -verify |
| 16 | +// RUN: %target-swift-frontend -typecheck %t/Client_Swift6.swift -I %t \ |
| 17 | +// RUN: -enable-library-evolution -swift-version 6 \ |
| 18 | +// RUN: -enable-experimental-feature AccessLevelOnImport -verify |
| 19 | + |
| 20 | +/// A non-resilient client doesn't complain. |
| 21 | +// RUN: %target-swift-frontend -typecheck %t/Client_Swift5.swift -I %t \ |
| 22 | +// RUN: -swift-version 5 \ |
| 23 | +// RUN: -enable-experimental-feature AccessLevelOnImport |
| 24 | +// RUN: %target-swift-frontend -typecheck %t/Client_Swift6.swift -I %t \ |
| 25 | +// RUN: -swift-version 6 \ |
| 26 | +// RUN: -enable-experimental-feature AccessLevelOnImport |
| 27 | + |
| 28 | +//--- DefaultLib.swift |
| 29 | +//--- PublicLib.swift |
| 30 | +//--- PackageLib.swift |
| 31 | +//--- InternalLib.swift |
| 32 | +//--- FileprivateLib.swift |
| 33 | +//--- PrivateLib.swift |
| 34 | + |
| 35 | +//--- Client_Swift5.swift |
| 36 | + |
| 37 | +import DefaultLib // expected-error {{module 'DefaultLib' was not compiled with library evolution support; using it means binary compatibility for 'Client_Swift5' can't be guaranteed}} {{1-1=internal }} |
| 38 | +public import PublicLib // expected-error {{module 'PublicLib' was not compiled with library evolution support; using it means binary compatibility for 'Client_Swift5' can't be guaranteed}} {{1-7=internal}} |
| 39 | +package import PackageLib |
| 40 | +internal import InternalLib |
| 41 | +fileprivate import FileprivateLib |
| 42 | +private import PrivateLib |
| 43 | + |
| 44 | +//--- Client_Swift6.swift |
| 45 | + |
| 46 | +import DefaultLib |
| 47 | +public import PublicLib // expected-error {{module 'PublicLib' was not compiled with library evolution support; using it means binary compatibility for 'Client_Swift6' can't be guaranteed}} {{1-7=internal}} |
| 48 | +package import PackageLib |
| 49 | +internal import InternalLib |
| 50 | +fileprivate import FileprivateLib |
| 51 | +private import PrivateLib |
0 commit comments