|
| 1 | +/// Test the generated swiftinterface with -alias-module-names-in-module-interface. |
| 2 | + |
| 3 | +// RUN: %empty-directory(%t) |
| 4 | +// RUN: split-file %s %t |
| 5 | + |
| 6 | +// RUN: %target-swift-frontend -emit-module \ |
| 7 | +// RUN: -swift-version 5 -enable-library-evolution \ |
| 8 | +// RUN: -o %t/PublicLib.swiftmodule %t/EmptyLib.swift |
| 9 | +// RUN: %target-swift-frontend -emit-module \ |
| 10 | +// RUN: -swift-version 5 -enable-library-evolution \ |
| 11 | +// RUN: -o %t/SPILib.swiftmodule %t/EmptyLib.swift |
| 12 | +// RUN: %target-swift-frontend -emit-module \ |
| 13 | +// RUN: -swift-version 5 -enable-library-evolution \ |
| 14 | +// RUN: -o %t/IOILib.swiftmodule %t/EmptyLib.swift |
| 15 | + |
| 16 | +// RUN: %target-swift-frontend -emit-module \ |
| 17 | +// RUN: -swift-version 5 -enable-library-evolution \ |
| 18 | +// RUN: -o %t/Client.swiftmodule \ |
| 19 | +// RUN: -emit-module-interface-path %t/Client.swiftinterface \ |
| 20 | +// RUN: -emit-private-module-interface-path %t/Client.private.swiftinterface \ |
| 21 | +// RUN: %t/Client.swift -I %t -experimental-spi-only-imports \ |
| 22 | +// RUN: -alias-module-names-in-module-interface |
| 23 | +// RUN: %target-swift-typecheck-module-from-interface(%t/Client.swiftinterface) -I%t |
| 24 | +// RUN: %target-swift-typecheck-module-from-interface(%t/Client.private.swiftinterface) -module-name Client -I%t |
| 25 | + |
| 26 | +// RUN: cat %t/Client.swiftinterface | %FileCheck %s -check-prefix=PUBLIC |
| 27 | +// RUN: cat %t/Client.private.swiftinterface | %FileCheck %s -check-prefix=PRIVATE |
| 28 | + |
| 29 | +//--- EmptyLib.swift |
| 30 | + |
| 31 | +public struct SomeType {} |
| 32 | + |
| 33 | +//--- Client.swift |
| 34 | + |
| 35 | +@_implementationOnly import IOILib |
| 36 | +@_spiOnly import SPILib |
| 37 | +import PublicLib |
| 38 | + |
| 39 | +/// Check alias declarations. |
| 40 | +// PUBLIC-NOT: IOILib |
| 41 | +// PUBLIC-NOT: SPILib |
| 42 | +// PUBLIC: -module-alias Module___PublicLib |
| 43 | +// PRIVATE-NOT: IOILib |
| 44 | +// PRIVATE: -module-alias Module___SPILib |
| 45 | +// PRIVATE: -module-alias Module___PublicLib |
| 46 | + |
| 47 | +/// Check imports. |
| 48 | +// PUBLIC: import Module___PublicLib |
| 49 | +// PRIVATE: import Module___PublicLib |
| 50 | +// PRIVATE: import Module___SPILib |
0 commit comments