|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: split-file %s %t |
| 3 | + |
| 4 | +// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O -I %t \ |
| 5 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ |
| 6 | +// RUN: %t/test.swift -o %t/deps.json -cache-compile-job -cas-path %t/cas -module-load-mode prefer-serialized |
| 7 | + |
| 8 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftShims > %t/shim.cmd |
| 9 | +// RUN: %swift_frontend_plain @%t/shim.cmd |
| 10 | + |
| 11 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:A > %t/A.cmd |
| 12 | +// RUN: %swift_frontend_plain @%t/A.cmd -Rcache-compile-job 2>&1 | %FileCheck %s --check-prefix=CHECK --check-prefix=CACHE-MISS |
| 13 | + |
| 14 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:A > %t/A.cmd |
| 15 | +// RUN: %swift_frontend_plain @%t/A.cmd -Rcache-compile-job 2>&1 | %FileCheck %s --check-prefix=CHECK --check-prefix=CACHE-HIT |
| 16 | + |
| 17 | +// CACHE-MISS: remark: cache miss for input |
| 18 | +// CHECK: <module-includes>:1 |
| 19 | +// CHECK-SAME: note: in file included from <module-includes>:1: |
| 20 | +// CHECK: warning: warning a.h |
| 21 | +// CACHE-HIT: remark: replay output file |
| 22 | + |
| 23 | +// RUN: %{python} %S/Inputs/GenerateExplicitModuleMap.py %t/deps.json > %t/map.json |
| 24 | +// RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid |
| 25 | + |
| 26 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd |
| 27 | +// RUN: echo "\"-disable-implicit-string-processing-module-import\"" >> %t/MyApp.cmd |
| 28 | +// RUN: echo "\"-disable-implicit-concurrency-module-import\"" >> %t/MyApp.cmd |
| 29 | +// RUN: echo "\"-disable-implicit-swift-modules\"" >> %t/MyApp.cmd |
| 30 | +// RUN: echo "\"-explicit-swift-module-map-file\"" >> %t/MyApp.cmd |
| 31 | +// RUN: echo "\"@%t/map.casid\"" >> %t/MyApp.cmd |
| 32 | + |
| 33 | +// RUN: %target-swift-frontend -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %t/test.swift \ |
| 34 | +// RUN: -emit-module -o %t/test.swiftmodule |
| 35 | + |
| 36 | +//--- module.modulemap |
| 37 | +module A { |
| 38 | + header "a.h" |
| 39 | + export * |
| 40 | +} |
| 41 | + |
| 42 | +//--- a.h |
| 43 | +#warning warning a.h |
| 44 | + |
| 45 | +//--- test.swift |
| 46 | +import A |
0 commit comments