]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/lto/cache.ll
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / lto / cache.ll
1 ; REQUIRES: x86
2
3 ; RUN: opt -module-hash -module-summary %s -o %t.o
4 ; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.o
5
6 ; RUN: rm -Rf %t.cache && mkdir %t.cache
7 ; Create two files that would be removed by cache pruning due to age.
8 ; We should only remove files matching the pattern "llvmcache-*".
9 ; RUN: touch -t 197001011200 %t.cache/llvmcache-foo %t.cache/foo
10 ; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy prune_after=1h:prune_interval=0s -o %t3 %t2.o %t.o
11
12 ; Two cached objects, plus a timestamp file and "foo", minus the file we removed.
13 ; RUN: ls %t.cache | count 4
14
15 ; Create a file of size 64KB.
16 ; RUN: "%python" -c "print(' ' * 65536)" > %t.cache/llvmcache-foo
17
18 ; This should leave the file in place.
19 ; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=128k:prune_interval=0s -o %t3 %t2.o %t.o
20 ; RUN: ls %t.cache | count 5
21
22 ; This should remove it.
23 ; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=32k:prune_interval=0s -o %t3 %t2.o %t.o
24 ; RUN: ls %t.cache | count 4
25
26 ; Setting max number of files to 0 should disable the limit, not delete everything.
27 ; 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
28 ; RUN: ls %t.cache | count 4
29
30 ; Delete everything except for the timestamp, "foo" and one cache file.
31 ; 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
32 ; RUN: ls %t.cache | count 3
33
34 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
35 target triple = "x86_64-unknown-linux-gnu"
36
37 define void @globalfunc() #0 {
38 entry:
39   ret void
40 }