|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: split-file %s %t |
| 3 | +// RUN: sed -e "s@VFS_DIR@%{/t:regex_replacement}/vfs@g" -e "s@EXTERNAL_DIR@%{/t:regex_replacement}/hidden@g" %t/base.yaml > %t/overlay.yaml |
| 4 | + |
| 5 | +// RUN: %target-swift-frontend -emit-module -module-name B -o %t/B.swiftmodule -swift-version 5 \ |
| 6 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ |
| 7 | +// RUN: -emit-module-interface-path %t/hidden/B.swiftinterface -enable-library-evolution %t/hidden/B.swift |
| 8 | + |
| 9 | +// RUN: %target-swift-frontend -scan-dependencies -module-name Test -module-cache-path %t/clang-module-cache -O \ |
| 10 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ |
| 11 | +// RUN: %t/vfs/test.swift -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas \ |
| 12 | +// RUN: -vfsoverlay %t/overlay.yaml -Xcc -ivfsoverlay -Xcc %t/overlay.yaml -I %t/vfs |
| 13 | + |
| 14 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:A > %t/A.cmd |
| 15 | +// RUN: %swift_frontend_plain @%t/A.cmd |
| 16 | + |
| 17 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json B > %t/B.cmd |
| 18 | +// RUN: %swift_frontend_plain @%t/B.cmd |
| 19 | + |
| 20 | +// RUN: %{python} %S/Inputs/GenerateExplicitModuleMap.py %t/deps.json > %t/map.json |
| 21 | +// RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid |
| 22 | + |
| 23 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd |
| 24 | +// RUN: %target-swift-frontend \ |
| 25 | +// RUN: -typecheck -cache-compile-job -cas-path %t/cas -vfsoverlay %t/overlay.yaml \ |
| 26 | +// RUN: -swift-version 5 -disable-implicit-swift-modules \ |
| 27 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ |
| 28 | +// RUN: -module-name Test -explicit-swift-module-map-file @%t/map.casid \ |
| 29 | +// RUN: %t/vfs/test.swift @%t/MyApp.cmd |
| 30 | + |
| 31 | +//--- hidden/test.swift |
| 32 | +import A |
| 33 | +import B |
| 34 | + |
| 35 | +//--- hidden/module.modulemap |
| 36 | +module A { |
| 37 | + header "A.h" |
| 38 | + export * |
| 39 | +} |
| 40 | + |
| 41 | +//--- hidden/A.h |
| 42 | +void a(void); |
| 43 | + |
| 44 | +//--- hidden/B.swift |
| 45 | +public func b() {} |
| 46 | + |
| 47 | +//--- base.yaml |
| 48 | +{ |
| 49 | + version: 0, |
| 50 | + roots: [ |
| 51 | + { |
| 52 | + type: "directory-remap", |
| 53 | + name: "VFS_DIR", |
| 54 | + external-contents: "EXTERNAL_DIR" |
| 55 | + } |
| 56 | + ] |
| 57 | +} |
0 commit comments