|
28 | 28 |
|
29 | 29 | // BAD_KEY: error: CAS cannot load module with key 'KEY' from -fmodule-file-cache-key: invalid cas-id 'KEY'
|
30 | 30 |
|
| 31 | +// RUN: echo -n '-fmodule-file-cache-key=PATH=' > %t/bad_key2.rsp |
| 32 | +// RUN: cat %t/casid >> %t/bad_key2.rsp |
| 33 | + |
| 34 | +// RUN: not %clang_cc1 -triple x86_64-apple-macos11 \ |
| 35 | +// RUN: -fmodules -fno-implicit-modules \ |
| 36 | +// RUN: @%t/bad_key2.rsp \ |
| 37 | +// RUN: -fsyntax-only %t/tu.c \ |
| 38 | +// RUN: -fcas-path %t/cas -faction-cache-path %t/cache -fcas-fs @%t/casid \ |
| 39 | +// RUN: -fcache-compile-job -Rcompile-job-cache &> %t/bad_key2.txt |
| 40 | +// RUN: cat %t/bad_key2.txt | FileCheck %s -check-prefix=BAD_KEY2 |
| 41 | + |
| 42 | +// BAD_KEY2: error: CAS cannot load module with key '{{.*}}' from -fmodule-file-cache-key: cas object is not a valid cache key |
| 43 | + |
| 44 | +// == Build A |
| 45 | + |
| 46 | +// RUN: %clang_cc1 -triple x86_64-apple-macos11 \ |
| 47 | +// RUN: -fmodules -fmodule-name=A -fno-implicit-modules \ |
| 48 | +// RUN: -emit-module %t/module.modulemap -o %t/A.pcm \ |
| 49 | +// RUN: -fcas-path %t/cas -faction-cache-path %t/cache -fcas-fs @%t/casid \ |
| 50 | +// RUN: -fcache-compile-job -Rcompile-job-cache &> %t/A.out.txt |
| 51 | +// RUN: cat %t/A.out.txt | FileCheck %s --check-prefix=CACHE-MISS |
| 52 | +// CACHE-MISS: remark: compile job cache miss |
| 53 | +// RUN: cat %t/A.out.txt | sed -E "s:^.*cache [a-z]+ for '([^']+)'.*$:\1:" > %t/A.key |
| 54 | + |
| 55 | +// == Try to import A with a different action cache, simulating a missing module |
| 56 | + |
31 | 57 | // RUN: echo -n '-fmodule-file-cache-key=PATH=' > %t/not_in_cache.rsp
|
32 |
| -// RUN: cat %t/casid >> %t/not_in_cache.rsp |
| 58 | +// RUN: cat %t/A.key >> %t/not_in_cache.rsp |
33 | 59 |
|
34 | 60 | // RUN: not %clang_cc1 -triple x86_64-apple-macos11 \
|
35 | 61 | // RUN: -fmodules -fno-implicit-modules \
|
36 | 62 | // RUN: @%t/not_in_cache.rsp \
|
37 | 63 | // RUN: -fsyntax-only %t/tu.c \
|
38 |
| -// RUN: -fcas-path %t/cas -faction-cache-path %t/cache -fcas-fs @%t/casid \ |
| 64 | +// RUN: -fcas-path %t/cas -faction-cache-path %t/cache_2 -fcas-fs @%t/casid \ |
39 | 65 | // RUN: -fcache-compile-job -Rcompile-job-cache &> %t/not_in_cache.txt
|
40 |
| -// RUN: cat %t/not_in_cache.txt | FileCheck %s -check-prefix=NOT_IN_CACHE |
| 66 | +// RUN: cat %t/not_in_cache.txt | FileCheck %s -check-prefix=NOT_IN_CACHE -DPREFIX=%/t |
41 | 67 |
|
42 |
| -// NOT_IN_CACHE: error: CAS cannot load module with key '{{.*}}' from -fmodule-file-cache-key: no such entry in action cache |
| 68 | +// NOT_IN_CACHE: error: CAS cannot load module with key '{{.*}}' from -fmodule-file-cache-key: no such entry in action cache; expected compile: |
| 69 | +// NOT_IN_CACHE: command-line: |
| 70 | +// NOT_IN_CACHE: -cc1 |
| 71 | +// NOT_IN_CACHE: filesystem: |
| 72 | +// NOT_IN_CACHE: file llvmcas://{{.*}} [[PREFIX]]/A.h |
43 | 73 |
|
44 | 74 | //--- module.modulemap
|
45 | 75 | module A { header "A.h" }
|
|
0 commit comments