2017-03-02 07:11:58 +08:00
|
|
|
; REQUIRES: x86
|
|
|
|
|
2017-03-02 07:00:10 +08:00
|
|
|
; RUN: opt -module-hash -module-summary %s -o %t.o
|
|
|
|
; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.o
|
|
|
|
|
2017-03-17 10:24:16 +08:00
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
2017-03-21 00:41:57 +08:00
|
|
|
; 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
|
2017-11-17 01:25:12 +08:00
|
|
|
; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy prune_after=1h:prune_interval=0s -o %t3 %t2.o %t.o
|
2017-03-02 07:00:10 +08:00
|
|
|
|
2017-03-21 00:41:57 +08:00
|
|
|
; Two cached objects, plus a timestamp file and "foo", minus the file we removed.
|
|
|
|
; RUN: ls %t.cache | count 4
|
2017-03-02 07:00:10 +08:00
|
|
|
|
2017-06-24 01:05:03 +08:00
|
|
|
; Create a file of size 64KB.
|
2018-02-21 08:03:41 +08:00
|
|
|
; RUN: "%python" -c "print(' ' * 65536)" > %t.cache/llvmcache-foo
|
2017-06-24 01:05:03 +08:00
|
|
|
|
|
|
|
; This should leave the file in place.
|
2017-11-17 01:25:12 +08:00
|
|
|
; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=128k:prune_interval=0s -o %t3 %t2.o %t.o
|
2017-06-24 01:05:03 +08:00
|
|
|
; RUN: ls %t.cache | count 5
|
|
|
|
|
|
|
|
; This should remove it.
|
2017-11-17 01:25:12 +08:00
|
|
|
; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=32k:prune_interval=0s -o %t3 %t2.o %t.o
|
2017-06-24 01:05:03 +08:00
|
|
|
; RUN: ls %t.cache | count 4
|
|
|
|
|
2017-11-23 02:27:31 +08:00
|
|
|
; Setting max number of files to 0 should disable the limit, not delete everything.
|
|
|
|
; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy prune_after=0s:cache_size=0%:cache_size_files=0:prune_interval=0s -o %t3 %t2.o %t.o
|
|
|
|
; RUN: ls %t.cache | count 4
|
|
|
|
|
|
|
|
; Delete everything except for the timestamp, "foo" and one cache file.
|
|
|
|
; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy prune_after=0s:cache_size=0%:cache_size_files=1:prune_interval=0s -o %t3 %t2.o %t.o
|
|
|
|
; RUN: ls %t.cache | count 3
|
|
|
|
|
2017-03-02 07:00:10 +08:00
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
define void @globalfunc() #0 {
|
|
|
|
entry:
|
|
|
|
ret void
|
|
|
|
}
|