1
1
// RUN: %empty-directory(%t)
2
2
// RUN: split-file %s %t
3
3
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.
4
9
// RUN: %target-swift-frontend -emit-module %t/PrivateLib.swift \
5
10
// RUN: -swift-version 5 -enable-library-evolution \
6
11
// RUN: -export-as PublicLib \
13
18
// RUN: cat %t/PrivateLib.swiftinterface | %FileCheck --check-prefixes=PRIVATELIB-PUBLIC %s
14
19
// RUN: cat %t/PrivateLib.private.swiftinterface | %FileCheck --check-prefixes=PRIVATELIB-PUBLIC %s
15
20
21
+ /// Build exporter.
16
22
// RUN: %target-swift-frontend -emit-module %t/PublicLib.swift -I %t \
17
23
// RUN: -swift-version 5 -enable-library-evolution \
18
24
// RUN: -o %t/PublicLib.swiftmodule \
22
28
// RUN: %target-swift-typecheck-module-from-interface(%t/PublicLib.private.swiftinterface) -I %t \
23
29
// RUN: -module-name PublicLib
24
30
// 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
26
32
27
- /// Default logic applying export-as in both swiftinterface .
33
+ /// Build client .
28
34
// RUN: %target-swift-frontend -emit-module %t/ClientLib.swift -I %t \
29
35
// RUN: -swift-version 5 -enable-library-evolution \
30
36
// RUN: -o %t/ClientLib.swiftmodule \
31
37
// RUN: -emit-module-interface-path %t/ClientLib.swiftinterface \
32
38
// RUN: -emit-private-module-interface-path %t/ClientLib.private.swiftinterface
33
39
// 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
35
41
// 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
37
43
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
40
46
// RUN: %target-swift-frontend -emit-module %t/ClientLib.swift -I %t \
41
47
// RUN: -swift-version 5 -enable-library-evolution \
42
48
// RUN: -o %t/ClientLib.swiftmodule \
43
49
// 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
46
51
// 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
48
53
// RUN: cat %t/ClientLib.swiftinterface | %FileCheck --check-prefixes=CLIENT-PUBLIC %s
49
54
// RUN: cat %t/ClientLib.private.swiftinterface | %FileCheck --check-prefixes=CLIENT-PRIVATE %s
50
55
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
53
58
// RUN: %target-swift-frontend -emit-module %t/ClientLib.swift -I %t \
54
59
// RUN: -swift-version 5 -enable-library-evolution \
55
60
// RUN: -o %t/ClientLib.swiftmodule \
56
61
// 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
59
63
// 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
61
65
// RUN: cat %t/ClientLib.swiftinterface | %FileCheck --check-prefixes=CLIENT-PUBLIC %s
62
66
// RUN: cat %t/ClientLib.private.swiftinterface | %FileCheck --check-prefixes=CLIENT-PRIVATE %s
63
67
@@ -76,6 +80,7 @@ public struct PublicNameStruct {}
76
80
77
81
public func publicLibUser( _ arg: PrivateNameStruct ) { }
78
82
// PUBLICLIB-PUBLIC: arg: PublicLib.PrivateNameStruct
83
+ // PUBLICLIB-PRIVATE: arg: PrivateLib.PrivateNameStruct
79
84
80
85
//--- ClientLib.swift
81
86
0 commit comments