|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | + |
| 3 | +// RUN: %target-swift-frontend -scan-dependencies -module-name Test -module-cache-path %t/clang-module-cache -O \ |
| 4 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ |
| 5 | +// RUN: %s -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas |
| 6 | + |
| 7 | +// RUN: %{python} %S/../CAS/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftShims > %t/shim.cmd |
| 8 | +// RUN: %swift_frontend_plain @%t/shim.cmd |
| 9 | + |
| 10 | +// RUN: %{python} %S/Inputs/GenerateExplicitModuleMap.py %t/deps.json > %t/map.json |
| 11 | +// RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid |
| 12 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd |
| 13 | + |
| 14 | +// RUN: %target-swift-frontend -c -cache-compile-job -cas-path %t/cas -O \ |
| 15 | +// RUN: -save-optimization-record -save-optimization-record-path %t/record.yaml \ |
| 16 | +// RUN: -swift-version 5 -disable-implicit-swift-modules \ |
| 17 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ |
| 18 | +// RUN: -module-name Test -explicit-swift-module-map-file @%t/map.casid \ |
| 19 | +// RUN: @%t/MyApp.cmd %s -o %t/test.o -Rcache-compile-job 2>&1 | %FileCheck %s --check-prefix=CACHE-MISS |
| 20 | + |
| 21 | +// RUN: %target-swift-frontend -c -cache-compile-job -cas-path %t/cas -O \ |
| 22 | +// RUN: -save-optimization-record -save-optimization-record-path %t/record-1.yaml \ |
| 23 | +// RUN: -swift-version 5 -disable-implicit-swift-modules \ |
| 24 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ |
| 25 | +// RUN: -module-name Test -explicit-swift-module-map-file @%t/map.casid \ |
| 26 | +// RUN: @%t/MyApp.cmd %s -o %t/test.o -Rcache-compile-job 2>&1 | %FileCheck %s --check-prefix=CACHE-HIT |
| 27 | + |
| 28 | +// RUN: %FileCheck %s --check-prefix=YAML --input-file=%t/record.yaml |
| 29 | + |
| 30 | +/// FIXME: Remarks are not produced when cache hit. |
| 31 | +// RUN: not %FileCheck %s --check-prefix=YAML --input-file=%t/record-1.yaml |
| 32 | + |
| 33 | +// CACHE-MISS: remark: cache miss for input |
| 34 | +// CACHE-HIT: remark: replay output file '<cached-diagnostics>': key 'llvmcas://{{.*}}' |
| 35 | +// CACHE-HIT: remark: replay output file '{{.*}}{{/|\\}}test.o': key 'llvmcas://{{.*}}' |
| 36 | +// YAML: --- |
| 37 | + |
| 38 | +var a: Int = 1 |
| 39 | + |
| 40 | +func foo() { |
| 41 | + a = 2 |
| 42 | +} |
| 43 | + |
| 44 | +public func bar() { |
| 45 | + foo() |
| 46 | +} |
0 commit comments