|
5 | 5 | // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \
|
6 | 6 | // RUN: -emit-module-interface-path %t/A.swiftinterface -enable-library-evolution -I %t %t/A.swift
|
7 | 7 |
|
8 |
| -// RUN: %target-swift-frontend -emit-module -module-name B -o %t/A.swiftmodule -swift-version 5 \ |
| 8 | +// RUN: %target-swift-frontend -emit-module -module-name B -o %t/B.swiftmodule -swift-version 5 \ |
9 | 9 | // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \
|
10 | 10 | // RUN: -emit-module-interface-path %t/B.swiftinterface -enable-library-evolution -I %t %t/B.swift
|
11 | 11 |
|
12 |
| -// RUN: %target-swift-frontend -emit-module -module-name _Cross -o %t/A.swiftmodule -swift-version 5 \ |
| 12 | +// RUN: %target-swift-frontend -emit-module -module-name _B_A -o %t/_B_A.swiftmodule -swift-version 5 \ |
13 | 13 | // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \
|
14 |
| -// RUN: -emit-module-interface-path %t/_Cross.swiftinterface -enable-library-evolution -I %t %t/cross.swift |
| 14 | +// RUN: -emit-module-interface-path %t/_B_A.swiftinterface -enable-library-evolution -I %t %t/b_a.swift |
15 | 15 |
|
16 |
| -// RUN: %target-swift-frontend -scan-dependencies -module-name Test -module-cache-path %t/clang-module-cache %t/main.swift \ |
| 16 | +// RUN: %target-swift-frontend -emit-module -module-name _C_A -o %t/_C_A.swiftmodule -swift-version 5 \ |
17 | 17 | // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \
|
18 |
| -// RUN: -o %t/deps.json -I %t -cache-compile-job -cas-path %t/cas -swift-version 5 -enable-cross-import-overlays -module-load-mode prefer-interface |
| 18 | +// RUN: -emit-module-interface-path %t/_C_A.swiftinterface -enable-library-evolution -I %t %t/c_a.swift |
19 | 19 |
|
20 |
| -// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json A > %t/A.cmd |
21 |
| -// RUN: %swift_frontend_plain @%t/A.cmd |
22 |
| -// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json B > %t/B.cmd |
23 |
| -// RUN: %swift_frontend_plain @%t/B.cmd |
24 |
| -// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json _Cross > %t/Cross.cmd |
25 |
| -// RUN: %swift_frontend_plain @%t/Cross.cmd |
| 20 | +// RUN: %target-swift-frontend -scan-dependencies -module-name Test -module-cache-path %t/clang-module-cache %t/main.swift -F %t \ |
| 21 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -O \ |
| 22 | +// RUN: -o %t/deps.json -I %t -cache-compile-job -cas-path %t/cas -swift-version 5 -enable-cross-import-overlays -module-load-mode prefer-serialized |
26 | 23 |
|
27 |
| -// RUN: %{python} %S/Inputs/GenerateExplicitModuleMap.py %t/deps.json > %t/map.json |
| 24 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftShims > %t/shim.cmd |
| 25 | +// RUN: %swift_frontend_plain @%t/shim.cmd |
| 26 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:C > %t/C.cmd |
| 27 | +// RUN: %swift_frontend_plain @%t/C.cmd |
| 28 | + |
| 29 | +// RUN: %{python} %S/Inputs/GenerateExplicitModuleMap.py %t/deps.json %t > %t/map.json |
28 | 30 | // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid
|
29 | 31 |
|
30 | 32 | // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd
|
| 33 | +// RUN: %FileCheck %s --input-file=%t/MyApp.cmd --check-prefix CMD |
| 34 | +// CMD: -swift-module-cross-import |
| 35 | +// CMD-NEXT: B |
| 36 | +// CMD-NEXT: A.swiftoverlay |
| 37 | +// CMD-NEXT: -swift-module-cross-import |
| 38 | +// CMD-NEXT: C |
| 39 | +// CMD-NEXT: A.swiftoverlay |
31 | 40 |
|
32 | 41 | // RUN: %target-swift-frontend -emit-module -o %t/Test.swiftmodule \
|
33 | 42 | // RUN: -emit-module-interface-path %t/Test.swiftinterface \
|
|
40 | 49 | // RUN: %FileCheck %s --input-file=%t/Test.swiftinterface
|
41 | 50 |
|
42 | 51 | /// Check to make sure the implicit cross import turned into explicit import in the interface file.
|
43 |
| -// CHECK: import _Cross |
| 52 | +// CHECK: import _B_A |
| 53 | +// CHECK: import _C_A |
44 | 54 |
|
45 | 55 | //--- A.swift
|
46 | 56 | public func a() {}
|
47 | 57 |
|
48 | 58 | //--- B.swift
|
49 | 59 | public func b() {}
|
50 | 60 |
|
51 |
| -//--- cross.swift |
52 |
| -public func cross() {} |
| 61 | +//--- b_a.swift |
| 62 | +public func b_a() {} |
| 63 | + |
| 64 | +//--- c_a.swift |
| 65 | +public func c_a() {} |
| 66 | + |
| 67 | +//--- C.framework/Modules/module.modulemap |
| 68 | +framework module C { |
| 69 | + umbrella header "C.h" |
| 70 | + export * |
| 71 | +} |
| 72 | + |
| 73 | +//--- C.framework/Headers/C.h |
| 74 | +void c(void); |
| 75 | + |
| 76 | +//--- C.framework/Modules/C.swiftcrossimport/A.swiftoverlay |
| 77 | +%YAML 1.2 |
| 78 | +--- |
| 79 | +version: 1 |
| 80 | +modules: |
| 81 | + - name: _C_A |
53 | 82 |
|
54 | 83 | //--- main.swift
|
55 | 84 | import A
|
56 | 85 | import B
|
| 86 | +import C |
57 | 87 |
|
58 | 88 | func test () {
|
59 |
| - cross() |
| 89 | + b_a() |
| 90 | + c_a() |
60 | 91 | }
|
61 | 92 |
|
62 | 93 | //--- B.swiftcrossimport/A.swiftoverlay
|
63 | 94 | %YAML 1.2
|
64 | 95 | ---
|
65 | 96 | version: 1
|
66 | 97 | modules:
|
67 |
| - - name: _Cross |
| 98 | + - name: _B_A |
0 commit comments