annotate clang/test/Modules/prune.m @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // NetBSD: noatime mounts currently inhibit 'touch -a' updates
anatofuz
parents:
diff changeset
2 // UNSUPPORTED: system-netbsd
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 // Test the automatic pruning of module cache entries.
anatofuz
parents:
diff changeset
5 #ifdef IMPORT_DEPENDS_ON_MODULE
anatofuz
parents:
diff changeset
6 @import DependsOnModule;
anatofuz
parents:
diff changeset
7 #else
anatofuz
parents:
diff changeset
8 @import Module;
anatofuz
parents:
diff changeset
9 #endif
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 // Clear out the module cache
anatofuz
parents:
diff changeset
12 // RUN: rm -rf %t
anatofuz
parents:
diff changeset
13 // Run Clang twice so we end up creating the timestamp file (the second time).
anatofuz
parents:
diff changeset
14 // RUN: %clang_cc1 -DIMPORT_DEPENDS_ON_MODULE -Wno-private-module -fmodules-ignore-macro=DIMPORT_DEPENDS_ON_MODULE -fmodules -fimplicit-module-maps -F %S/Inputs -fmodules-cache-path=%t %s -verify
anatofuz
parents:
diff changeset
15 // RUN: %clang_cc1 -DIMPORT_DEPENDS_ON_MODULE -Wno-private-module -fmodules-ignore-macro=DIMPORT_DEPENDS_ON_MODULE -fmodules -fimplicit-module-maps -F %S/Inputs -fmodules-cache-path=%t %s -verify
anatofuz
parents:
diff changeset
16 // RUN: ls %t | grep modules.timestamp
anatofuz
parents:
diff changeset
17 // RUN: ls -R %t | grep ^Module.*pcm
anatofuz
parents:
diff changeset
18 // RUN: ls -R %t | grep DependsOnModule.*pcm
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 // Set the timestamp back more than two days. We should try to prune,
anatofuz
parents:
diff changeset
21 // but nothing gets pruned because the module files are new enough.
anatofuz
parents:
diff changeset
22 // RUN: touch -m -a -t 201101010000 %t/modules.timestamp
anatofuz
parents:
diff changeset
23 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -Wno-private-module -F %S/Inputs -fmodules-cache-path=%t -fmodules -fmodules-prune-interval=172800 -fmodules-prune-after=345600 %s -verify
anatofuz
parents:
diff changeset
24 // RUN: ls %t | grep modules.timestamp
anatofuz
parents:
diff changeset
25 // RUN: ls -R %t | grep ^Module.*pcm
anatofuz
parents:
diff changeset
26 // RUN: ls -R %t | grep DependsOnModule.*pcm
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 // Set the DependsOnModule access time back more than four days.
anatofuz
parents:
diff changeset
29 // This shouldn't prune anything, because the timestamp has been updated, so
anatofuz
parents:
diff changeset
30 // the pruning mechanism won't fire.
anatofuz
parents:
diff changeset
31 // RUN: find %t -name DependsOnModule*.pcm | sed -e 's/\\/\//g' | xargs touch -a -t 201101010000
anatofuz
parents:
diff changeset
32 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -F %S/Inputs -Wno-private-module -fmodules-cache-path=%t -fmodules -fmodules-prune-interval=172800 -fmodules-prune-after=345600 %s -verify
anatofuz
parents:
diff changeset
33 // RUN: ls %t | grep modules.timestamp
anatofuz
parents:
diff changeset
34 // RUN: ls -R %t | grep ^Module.*pcm
anatofuz
parents:
diff changeset
35 // RUN: ls -R %t | grep DependsOnModule.*pcm
anatofuz
parents:
diff changeset
36
anatofuz
parents:
diff changeset
37 // Set both timestamp and DependsOnModule.pcm back beyond the cutoff.
anatofuz
parents:
diff changeset
38 // This should trigger pruning, which will remove DependsOnModule but not Module.
anatofuz
parents:
diff changeset
39 // RUN: touch -m -a -t 201101010000 %t/modules.timestamp
anatofuz
parents:
diff changeset
40 // RUN: find %t -name DependsOnModule*.pcm | sed -e 's/\\/\//g' | xargs touch -a -t 201101010000
anatofuz
parents:
diff changeset
41 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -F %S/Inputs -Wno-private-module -fmodules-cache-path=%t -fmodules -fmodules-prune-interval=172800 -fmodules-prune-after=345600 %s -verify
anatofuz
parents:
diff changeset
42 // RUN: ls %t | grep modules.timestamp
anatofuz
parents:
diff changeset
43 // RUN: ls -R %t | grep ^Module.*pcm
anatofuz
parents:
diff changeset
44 // RUN: ls -R %t | not grep DependsOnModule.*pcm
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 // expected-no-diagnostics