1// RUN: rm -rf %t
2
3// Build Module and set its timestamp
4// RUN: echo '@import Module;' | %clang_cc1 -fmodules -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 -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 -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// But the signature at least is expected to change, so we rebuild DependsOnModule.
23// NOTE: if we change how the signature is created, this test may need updating.
24// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash -fsyntax-only -F %S/Inputs %s
25// RUN: diff %t/Module.pcm %t/Module.pcm.saved.2
26// RUN: not diff %t/DependsOnModule.pcm %t/DependsOnModule.pcm.saved
27
28// Rebuild Module, reset its timestamp, and verify its size hasn't changed
29// RUN: rm %t/Module.pcm
30// RUN: echo '@import Module;' | %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash -fsyntax-only -F %S/Inputs -x objective-c -
31// RUN: touch -m -a -t 201101010000 %t/Module.pcm
32// RUN: wc -c %t/Module.pcm > %t/Module.size
33// RUN: diff %t/Module.size %t/Module.size.saved
34// RUN: cp %t/Module.pcm %t/Module.pcm.saved.2
35
36// Verify again with Module pre-imported.
37// NOTE: if we change how the signature is created, this test may need updating.
38// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash -fsyntax-only -F %S/Inputs %s
39// RUN: diff %t/Module.pcm %t/Module.pcm.saved.2
40// RUN: not diff %t/DependsOnModule.pcm %t/DependsOnModule.pcm.saved
41
42#ifdef PREIMPORT
43@import Module;
44#endif
45@import DependsOnModule;
46