11// RUN: %empty-directory(%t)
22// RUN: split-file %s %t
33
4+ /// Make sure the flag `ModuleInterfaceExportAs` doesn't raise an error.
5+ // RUN: %target-swift-frontend -emit-module %t/PrivateLib.swift \
6+ // RUN: -enable-experimental-feature ModuleInterfaceExportAs
7+
8+ /// Build exportee.
49// RUN: %target-swift-frontend -emit-module %t/PrivateLib.swift \
510// RUN: -swift-version 5 -enable-library-evolution \
611// RUN: -export-as PublicLib \
1318// RUN: cat %t/PrivateLib.swiftinterface | %FileCheck --check-prefixes=PRIVATELIB-PUBLIC %s
1419// RUN: cat %t/PrivateLib.private.swiftinterface | %FileCheck --check-prefixes=PRIVATELIB-PUBLIC %s
1520
21+ /// Build exporter.
1622// RUN: %target-swift-frontend -emit-module %t/PublicLib.swift -I %t \
1723// RUN: -swift-version 5 -enable-library-evolution \
1824// RUN: -o %t/PublicLib.swiftmodule \
2228// RUN: %target-swift-typecheck-module-from-interface(%t/PublicLib.private.swiftinterface) -I %t \
2329// RUN: -module-name PublicLib
2430// RUN: cat %t/PublicLib.swiftinterface | %FileCheck --check-prefixes=PUBLICLIB-PUBLIC %s
25- // RUN: cat %t/PublicLib.private.swiftinterface | %FileCheck --check-prefixes=PUBLICLIB-PUBLIC %s
31+ // RUN: cat %t/PublicLib.private.swiftinterface | %FileCheck --check-prefixes=PUBLICLIB-PRIVATE %s
2632
27- /// Default logic applying export-as in both swiftinterface .
33+ /// Build client .
2834// RUN: %target-swift-frontend -emit-module %t/ClientLib.swift -I %t \
2935// RUN: -swift-version 5 -enable-library-evolution \
3036// RUN: -o %t/ClientLib.swiftmodule \
3137// RUN: -emit-module-interface-path %t/ClientLib.swiftinterface \
3238// RUN: -emit-private-module-interface-path %t/ClientLib.private.swiftinterface
3339// RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.swiftinterface) -I %t
34- // RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.private.swiftinterface) -I %t
40+ // RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.private.swiftinterface) -I %t -module-name ClientLib
3541// RUN: cat %t/ClientLib.swiftinterface | %FileCheck --check-prefixes=CLIENT-PUBLIC %s
36- // RUN: cat %t/ClientLib.private.swiftinterface | %FileCheck --check-prefixes=CLIENT-PUBLIC %s
42+ // RUN: cat %t/ClientLib.private.swiftinterface | %FileCheck --check-prefixes=CLIENT-PRIVATE %s
3743
38- /// New logic applying export-as only in the public swiftinterface with
39- /// `-enable-experimental-feature ModuleInterfaceExportAs`.
44+ /// Build client against private swiftinterfaces.
45+ // RUN: rm -f %t/PrivateLib.swiftmodule %t/PublicLib.swiftmodule
4046// RUN: %target-swift-frontend -emit-module %t/ClientLib.swift -I %t \
4147// RUN: -swift-version 5 -enable-library-evolution \
4248// RUN: -o %t/ClientLib.swiftmodule \
4349// RUN: -emit-module-interface-path %t/ClientLib.swiftinterface \
44- // RUN: -emit-private-module-interface-path %t/ClientLib.private.swiftinterface \
45- // RUN: -enable-experimental-feature ModuleInterfaceExportAs
50+ // RUN: -emit-private-module-interface-path %t/ClientLib.private.swiftinterface
4651// RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.swiftinterface) -I %t
47- // RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.private.swiftinterface) -I %t
52+ // RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.private.swiftinterface) -I %t -module-name ClientLib
4853// RUN: cat %t/ClientLib.swiftinterface | %FileCheck --check-prefixes=CLIENT-PUBLIC %s
4954// RUN: cat %t/ClientLib.private.swiftinterface | %FileCheck --check-prefixes=CLIENT-PRIVATE %s
5055
51- /// Check that we get the same behavior using swiftinterfaces only .
52- // RUN: rm -f %t/PrivateLib.swiftmodule %t/PublicLib.swiftmodule
56+ /// Build client against public swiftinterfaces, for the same result .
57+ // RUN: rm -f %t/PrivateLib.private.swiftinterface %t/PublicLib.private.swiftinterface
5358// RUN: %target-swift-frontend -emit-module %t/ClientLib.swift -I %t \
5459// RUN: -swift-version 5 -enable-library-evolution \
5560// RUN: -o %t/ClientLib.swiftmodule \
5661// RUN: -emit-module-interface-path %t/ClientLib.swiftinterface \
57- // RUN: -emit-private-module-interface-path %t/ClientLib.private.swiftinterface \
58- // RUN: -enable-experimental-feature ModuleInterfaceExportAs
62+ // RUN: -emit-private-module-interface-path %t/ClientLib.private.swiftinterface
5963// RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.swiftinterface) -I %t
60- // RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.private.swiftinterface) -I %t
64+ // RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.private.swiftinterface) -I %t -module-name ClientLib
6165// RUN: cat %t/ClientLib.swiftinterface | %FileCheck --check-prefixes=CLIENT-PUBLIC %s
6266// RUN: cat %t/ClientLib.private.swiftinterface | %FileCheck --check-prefixes=CLIENT-PRIVATE %s
6367
@@ -76,6 +80,7 @@ public struct PublicNameStruct {}
7680
7781public func publicLibUser( _ arg: PrivateNameStruct ) { }
7882// PUBLICLIB-PUBLIC: arg: PublicLib.PrivateNameStruct
83+ // PUBLICLIB-PRIVATE: arg: PrivateLib.PrivateNameStruct
7984
8085//--- ClientLib.swift
8186
0 commit comments