|
6 | 6 | // RUN: mkdir -p %t/modules-to-compare
|
7 | 7 |
|
8 | 8 | // ===
|
9 |
| -// Create a module with system headers. |
| 9 | +// Create a module. We will use -I or -isystem to determine whether to treat |
| 10 | +// foo.h as a system header. |
10 | 11 | // RUN: echo 'void meow(void);' > %t/Inputs/foo.h
|
11 |
| -// RUN: echo 'module Foo [system] { header "foo.h" }' > %t/Inputs/module.map |
| 12 | +// RUN: echo 'module Foo { header "foo.h" }' > %t/Inputs/module.map |
12 | 13 |
|
13 | 14 | // ===
|
14 | 15 | // Compile the module.
|
15 |
| -// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -fsyntax-only -I %t/Inputs -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s |
| 16 | +// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -fsyntax-only -isystem %t/Inputs -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s |
| 17 | +// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache-user -fsyntax-only -I %t/Inputs -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s |
16 | 18 | // RUN: ls -R %t/modules-cache | grep Foo.pcm.timestamp
|
| 19 | +// RUN: ls -R %t/modules-cache-user | grep Foo.pcm.timestamp |
17 | 20 | // RUN: cp %t/modules-cache/Foo.pcm %t/modules-to-compare/Foo-before.pcm
|
| 21 | +// RUN: cp %t/modules-cache-user/Foo.pcm %t/modules-to-compare/Foo-before-user.pcm |
18 | 22 |
|
19 | 23 | // ===
|
20 | 24 | // Use it, and make sure that we did not recompile it.
|
21 |
| -// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -fsyntax-only -I %t/Inputs -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s |
| 25 | +// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -fsyntax-only -isystem %t/Inputs -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s |
| 26 | +// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache-user -fsyntax-only -I %t/Inputs -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s |
22 | 27 | // RUN: ls -R %t/modules-cache | grep Foo.pcm.timestamp
|
| 28 | +// RUN: ls -R %t/modules-cache-user | grep Foo.pcm.timestamp |
23 | 29 | // RUN: cp %t/modules-cache/Foo.pcm %t/modules-to-compare/Foo-after.pcm
|
| 30 | +// RUN: cp %t/modules-cache-user/Foo.pcm %t/modules-to-compare/Foo-after-user.pcm |
24 | 31 |
|
25 | 32 | // RUN: diff %t/modules-to-compare/Foo-before.pcm %t/modules-to-compare/Foo-after.pcm
|
| 33 | +// RUN: diff %t/modules-to-compare/Foo-before-user.pcm %t/modules-to-compare/Foo-after-user.pcm |
26 | 34 |
|
27 | 35 | // ===
|
28 | 36 | // Change the sources.
|
29 | 37 | // RUN: echo 'void meow2(void);' > %t/Inputs/foo.h
|
30 | 38 |
|
31 | 39 | // ===
|
32 |
| -// Use the module, and make sure that we did not recompile it, even though the sources changed. |
33 |
| -// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -fsyntax-only -I %t/Inputs -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s |
| 40 | +// Use the module, and make sure that we did not recompile it if foo.h is a |
| 41 | +// system header, even though the sources changed. |
| 42 | +// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -fsyntax-only -isystem %t/Inputs -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s |
| 43 | +// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache-user -fsyntax-only -I %t/Inputs -fbuild-session-timestamp=1390000000 -fmodules-validate-once-per-build-session %s |
34 | 44 | // RUN: ls -R %t/modules-cache | grep Foo.pcm.timestamp
|
| 45 | +// RUN: ls -R %t/modules-cache-user | grep Foo.pcm.timestamp |
35 | 46 | // RUN: cp %t/modules-cache/Foo.pcm %t/modules-to-compare/Foo-after.pcm
|
| 47 | +// RUN: cp %t/modules-cache-user/Foo.pcm %t/modules-to-compare/Foo-after-user.pcm |
36 | 48 |
|
37 | 49 | // RUN: diff %t/modules-to-compare/Foo-before.pcm %t/modules-to-compare/Foo-after.pcm
|
| 50 | +// When foo.h is a user header, we will always validate it. |
| 51 | +// RUN: not diff %t/modules-to-compare/Foo-before-user.pcm %t/modules-to-compare/Foo-after-user.pcm |
38 | 52 |
|
39 | 53 | // ===
|
40 | 54 | // Recompile the module if the today's date is before 01 January 2030.
|
41 |
| -// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -fsyntax-only -I %t/Inputs -fbuild-session-timestamp=1893456000 -fmodules-validate-once-per-build-session %s |
| 55 | +// RUN: %clang_cc1 -cc1 -fmodules -fdisable-module-hash -fmodules-cache-path=%t/modules-cache -fsyntax-only -isystem %t/Inputs -fbuild-session-timestamp=1893456000 -fmodules-validate-once-per-build-session %s |
42 | 56 | // RUN: ls -R %t/modules-cache | grep Foo.pcm.timestamp
|
43 | 57 | // RUN: cp %t/modules-cache/Foo.pcm %t/modules-to-compare/Foo-after.pcm
|
44 | 58 |
|
|
0 commit comments