1 | // RUN: rm -rf %t |
2 | |
3 | // Build Module and set its timestamp |
4 | // RUN: echo '@import Module;' | %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash -fsyntax-only -F %S/Inputs -x objective-c - |
5 | // RUN: touch -m -a -t 201101010000 %t/Module.pcm |
6 | // RUN: cp %t/Module.pcm %t/Module.pcm.saved |
7 | // RUN: wc -c %t/Module.pcm > %t/Module.size.saved |
8 | |
9 | // Build DependsOnModule |
10 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash -fsyntax-only -F %S/Inputs %s |
11 | // RUN: diff %t/Module.pcm %t/Module.pcm.saved |
12 | // RUN: cp %t/DependsOnModule.pcm %t/DependsOnModule.pcm.saved |
13 | |
14 | // Rebuild Module, reset its timestamp, and verify its size hasn't changed |
15 | // RUN: rm %t/Module.pcm |
16 | // RUN: echo '@import Module;' | %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash -fsyntax-only -F %S/Inputs -x objective-c - |
17 | // RUN: touch -m -a -t 201101010000 %t/Module.pcm |
18 | // RUN: wc -c %t/Module.pcm > %t/Module.size |
19 | // RUN: diff %t/Module.size %t/Module.size.saved |
20 | // RUN: cp %t/Module.pcm %t/Module.pcm.saved.2 |
21 | |
22 | // The signature is the hash of the PCM content, we will not rebuild rebuild DependsOnModule. |
23 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash -fsyntax-only -F %S/Inputs %s |
24 | // RUN: diff %t/Module.pcm %t/Module.pcm.saved.2 |
25 | // RUN: diff %t/DependsOnModule.pcm %t/DependsOnModule.pcm.saved |
26 | |
27 | // Rebuild Module, reset its timestamp, and verify its size hasn't changed |
28 | // RUN: rm %t/Module.pcm |
29 | // RUN: echo '@import Module;' | %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash -fsyntax-only -F %S/Inputs -x objective-c - |
30 | // RUN: touch -m -a -t 201101010000 %t/Module.pcm |
31 | // RUN: wc -c %t/Module.pcm > %t/Module.size |
32 | // RUN: diff %t/Module.size %t/Module.size.saved |
33 | // RUN: cp %t/Module.pcm %t/Module.pcm.saved.2 |
34 | |
35 | // Verify again with Module pre-imported. |
36 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash -fsyntax-only -F %S/Inputs %s |
37 | // RUN: diff %t/Module.pcm %t/Module.pcm.saved.2 |
38 | // RUN: diff %t/DependsOnModule.pcm %t/DependsOnModule.pcm.saved |
39 | |
40 | #ifdef PREIMPORT |
41 | @import Module; |
42 | #endif |
43 | @import DependsOnModule; |
44 | |