|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: split-file %s %t |
| 3 | + |
| 4 | +// RUN: %target-swift-frontend -emit-module %t/A.swift -I %t -module-name A \ |
| 5 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ |
| 6 | +// RUN: -enable-library-evolution -swift-version 5 \ |
| 7 | +// RUN: -emit-module-interface-path %t/A.swiftinterface \ |
| 8 | +// RUN: -o %t/A.swiftmodule |
| 9 | + |
| 10 | +// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O -module-cache-path %t/clang-module-cache \ |
| 11 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ |
| 12 | +// RUN: %t/test.swift -I %t -o %t/deps.json -cache-compile-job -cas-path %t/cas |
| 13 | + |
| 14 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:B > %t/B.cmd |
| 15 | +// RUN: %swift_frontend_plain @%t/B.cmd |
| 16 | + |
| 17 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json A > %t/A.cmd |
| 18 | +// RUN: %swift_frontend_plain @%t/A.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 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd |
| 23 | + |
| 24 | +// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -o %t/Test.swiftmodule \ |
| 25 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ |
| 26 | +// RUN: -disable-implicit-swift-modules -explicit-swift-module-map-file @%t/map.casid \ |
| 27 | +// RUN: -module-name Test -cas-path %t/cas @%t/MyApp.cmd -index-system-modules -index-store-path %t/db 2>&1 | %FileCheck --check-prefix=CACHE-MISS %s |
| 28 | +// RUN: ls %t/db |
| 29 | + |
| 30 | +/// Cache hit with a different index-store-path. Note cache hit will skip replay index data. |
| 31 | +// RUN: %target-swift-frontend -cache-compile-job -Rcache-compile-job %t/test.swift -O -emit-module -o %t/Test.swiftmodule \ |
| 32 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ |
| 33 | +// RUN: -disable-implicit-swift-modules -explicit-swift-module-map-file @%t/map.casid \ |
| 34 | +// RUN: -module-name Test -cas-path %t/cas @%t/MyApp.cmd -index-system-modules -index-store-path %t/db2 2>&1 | %FileCheck --check-prefix=CACHE-HIT %s |
| 35 | +// RUN: not ls %t/db2 |
| 36 | + |
| 37 | +// CACHE-MISS: remark: cache miss for input |
| 38 | +// CACHE-HIT: remark: replay output file |
| 39 | + |
| 40 | +//--- test.swift |
| 41 | +import A |
| 42 | +import B |
| 43 | +func test() {} |
| 44 | + |
| 45 | +//--- A.swift |
| 46 | +func a() {} |
| 47 | + |
| 48 | +//--- module.modulemap |
| 49 | +module B { |
| 50 | + header "B.h" |
| 51 | + export * |
| 52 | +} |
| 53 | + |
| 54 | +//--- B.h |
| 55 | +void b(void); |
0 commit comments