1
1
// RUN: %empty-directory(%t)
2
2
// RUN: split-file %s %t
3
3
4
+ /// Build exportee.
4
5
// RUN: %target-swift-frontend -emit-module %t/PrivateLib.swift \
5
6
// RUN: -swift-version 5 -enable-library-evolution \
6
7
// RUN: -export-as PublicLib \
13
14
// RUN: cat %t/PrivateLib.swiftinterface | %FileCheck --check-prefixes=PRIVATELIB-PUBLIC %s
14
15
// RUN: cat %t/PrivateLib.private.swiftinterface | %FileCheck --check-prefixes=PRIVATELIB-PUBLIC %s
15
16
17
+ /// Build exporter.
16
18
// RUN: %target-swift-frontend -emit-module %t/PublicLib.swift -I %t \
17
19
// RUN: -swift-version 5 -enable-library-evolution \
18
20
// RUN: -o %t/PublicLib.swiftmodule \
22
24
// RUN: %target-swift-typecheck-module-from-interface(%t/PublicLib.private.swiftinterface) -I %t \
23
25
// RUN: -module-name PublicLib
24
26
// RUN: cat %t/PublicLib.swiftinterface | %FileCheck --check-prefixes=PUBLICLIB-PUBLIC %s
25
- // RUN: cat %t/PublicLib.private.swiftinterface | %FileCheck --check-prefixes=PUBLICLIB-PUBLIC %s
27
+ // RUN: cat %t/PublicLib.private.swiftinterface | %FileCheck --check-prefixes=PUBLICLIB-PRIVATE %s
26
28
27
- /// Default logic applying export-as in both swiftinterface .
29
+ /// Build client .
28
30
// RUN: %target-swift-frontend -emit-module %t/ClientLib.swift -I %t \
29
31
// RUN: -swift-version 5 -enable-library-evolution \
30
32
// RUN: -o %t/ClientLib.swiftmodule \
31
33
// RUN: -emit-module-interface-path %t/ClientLib.swiftinterface \
32
34
// RUN: -emit-private-module-interface-path %t/ClientLib.private.swiftinterface
33
35
// 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
36
+ // RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.private.swiftinterface) -I %t -module-name ClientLib
35
37
// RUN: cat %t/ClientLib.swiftinterface | %FileCheck --check-prefixes=CLIENT-PUBLIC %s
36
- // RUN: cat %t/ClientLib.private.swiftinterface | %FileCheck --check-prefixes=CLIENT-PUBLIC %s
38
+ // RUN: cat %t/ClientLib.private.swiftinterface | %FileCheck --check-prefixes=CLIENT-PRIVATE %s
37
39
38
- /// New logic applying export-as only in the public swiftinterface with
39
- /// `-enable-experimental-feature ModuleInterfaceExportAs`.
40
+ /// Build client against private swiftinterfaces.
41
+ // RUN: rm -f %t/PrivateLib.swiftmodule %t/PublicLib.swiftmodule
40
42
// RUN: %target-swift-frontend -emit-module %t/ClientLib.swift -I %t \
41
43
// RUN: -swift-version 5 -enable-library-evolution \
42
44
// RUN: -o %t/ClientLib.swiftmodule \
43
45
// 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
46
+ // RUN: -emit-private-module-interface-path %t/ClientLib.private.swiftinterface
46
47
// 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
48
+ // RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.private.swiftinterface) -I %t -module-name ClientLib
48
49
// RUN: cat %t/ClientLib.swiftinterface | %FileCheck --check-prefixes=CLIENT-PUBLIC %s
49
50
// RUN: cat %t/ClientLib.private.swiftinterface | %FileCheck --check-prefixes=CLIENT-PRIVATE %s
50
51
51
- /// Check that we get the same behavior using swiftinterfaces only .
52
- // RUN: rm -f %t/PrivateLib.swiftmodule %t/PublicLib.swiftmodule
52
+ /// Build client against public swiftinterfaces, for the same result .
53
+ // RUN: rm -f %t/PrivateLib.private.swiftinterface %t/PublicLib.private.swiftinterface
53
54
// RUN: %target-swift-frontend -emit-module %t/ClientLib.swift -I %t \
54
55
// RUN: -swift-version 5 -enable-library-evolution \
55
56
// RUN: -o %t/ClientLib.swiftmodule \
56
57
// 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
58
+ // RUN: -emit-private-module-interface-path %t/ClientLib.private.swiftinterface
59
59
// 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
60
+ // RUN: %target-swift-typecheck-module-from-interface(%t/ClientLib.private.swiftinterface) -I %t -module-name ClientLib
61
61
// RUN: cat %t/ClientLib.swiftinterface | %FileCheck --check-prefixes=CLIENT-PUBLIC %s
62
62
// RUN: cat %t/ClientLib.private.swiftinterface | %FileCheck --check-prefixes=CLIENT-PRIVATE %s
63
63
@@ -76,6 +76,7 @@ public struct PublicNameStruct {}
76
76
77
77
public func publicLibUser( _ arg: PrivateNameStruct ) { }
78
78
// PUBLICLIB-PUBLIC: arg: PublicLib.PrivateNameStruct
79
+ // PUBLICLIB-PRIVATE: arg: PrivateLib.PrivateNameStruct
79
80
80
81
//--- ClientLib.swift
81
82
0 commit comments