[lld] r298271 - Support, LTO: When pruning a directory, ignore files matching a prefix.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 20 09:41:57 PDT 2017
Author: pcc
Date: Mon Mar 20 11:41:57 2017
New Revision: 298271
URL: http://llvm.org/viewvc/llvm-project?rev=298271&view=rev
Log:
Support, LTO: When pruning a directory, ignore files matching a prefix.
This is a safeguard against data loss if the user specifies a directory
that is not a cache directory. Teach the existing cache pruning clients
to create files with appropriate names.
Differential Revision: https://reviews.llvm.org/D31109
Modified:
lld/trunk/test/ELF/lto/cache.ll
Modified: lld/trunk/test/ELF/lto/cache.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/cache.ll?rev=298271&r1=298270&r2=298271&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/cache.ll (original)
+++ lld/trunk/test/ELF/lto/cache.ll Mon Mar 20 11:41:57 2017
@@ -4,12 +4,13 @@
; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.o
; RUN: rm -Rf %t.cache && mkdir %t.cache
-; Create a file that will be removed by cache pruning due to age.
-; RUN: touch -t 197001011200 %t.cache/foo
+; Create two files that would be removed by cache pruning due to age.
+; We should only remove files matching the pattern "llvmcache-*".
+; RUN: touch -t 197001011200 %t.cache/llvmcache-foo %t.cache/foo
; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy prune_after=1h -o %t3 %t2.o %t.o
-; Two cached objects, plus a timestamp file, minus the file we removed.
-; RUN: ls %t.cache | count 3
+; Two cached objects, plus a timestamp file and "foo", minus the file we removed.
+; RUN: ls %t.cache | count 4
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
More information about the llvm-commits
mailing list