|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: split-file %s %t |
| 3 | + |
| 4 | +//--- SPIDependency.swift |
| 5 | + |
| 6 | +// RUN: %target-swift-frontend -emit-module %t/SPIDependency.swift -o %t \ |
| 7 | +// RUN: -enable-library-evolution -swift-version 5 |
| 8 | + |
| 9 | +//--- Lib.swift |
| 10 | + |
| 11 | +// RUN: %target-swift-frontend -emit-module %t/Lib.swift -o %t -I %t \ |
| 12 | +// RUN: -enable-library-evolution -swift-version 5 \ |
| 13 | +// RUN: -emit-module-path %t/Lib.swiftmodule \ |
| 14 | +// RUN: -emit-module-interface-path %t/Lib.swiftinterface \ |
| 15 | +// RUN: -emit-private-module-interface-path %t/Lib.private.swiftinterface \ |
| 16 | +// RUN: -experimental-spi-only-imports |
| 17 | + |
| 18 | +@_spiOnly import SPIDependency |
| 19 | + |
| 20 | +//--- Client.swift |
| 21 | + |
| 22 | +/// SPIDependency is visible when using the swiftmodule or private interface. |
| 23 | +// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \ |
| 24 | +// RUN: -experimental-spi-only-imports \ |
| 25 | +// RUN: -Rmodule-loading 2>&1 | %FileCheck -check-prefix=VISIBLE-DEP %s |
| 26 | +// VISIBLE-DEP: loaded module 'SPIDependency' |
| 27 | + |
| 28 | +// RUN: rm %t/Lib.swiftmodule |
| 29 | +// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \ |
| 30 | +// RUN: -experimental-spi-only-imports \ |
| 31 | +// RUN: -Rmodule-loading 2>&1 | %FileCheck -check-prefix=VISIBLE-DEP %s |
| 32 | + |
| 33 | +/// SPIDependency is not visible when using the public swiftinterface. |
| 34 | +// RUN: rm %t/Lib.private.swiftinterface |
| 35 | +// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \ |
| 36 | +// RUN: -experimental-spi-only-imports \ |
| 37 | +// RUN: -Rmodule-loading 2>&1 | %FileCheck -check-prefix=VISIBLE-DEP-NOT %s |
| 38 | +// VISIBLE-DEP-NOT-NOT: loaded module 'SPIDependency' |
| 39 | + |
| 40 | +import Lib |
0 commit comments