brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 9ddf276 Raw
45 lines · plain
1; RUN: opt -module-hash -module-summary %s -o %t.o2; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.o3; NetBSD: noatime mounts currently inhibit 'touch' from updating atime4; Windows: no 'touch' command.5; UNSUPPORTED: system-netbsd, system-windows6 7; RUN: rm -Rf %t.cache && mkdir %t.cache8; Create two files that would be removed by cache pruning due to age.9; We should only remove files matching the pattern "llvmcache-*".10; RUN: touch -t 197001011200 %t.cache/llvmcache-foo %t.cache/foo11; RUN: wasm-ld --thinlto-cache-dir=%t.cache --thinlto-cache-policy prune_after=1h:prune_interval=0s -o %t.wasm %t2.o %t.o12 13; Two cached objects, plus a timestamp file and "foo", minus the file we removed.14; RUN: ls %t.cache | count 415 16; Create a file of size 64KB.17; RUN: %python -c "print(' ' * 65536)" > %t.cache/llvmcache-foo18 19; This should leave the file in place.20; RUN: wasm-ld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=128k:prune_interval=0s -o %t.wasm %t2.o %t.o21; RUN: ls %t.cache | count 522 23; Increase the age of llvmcache-foo, which will give it the oldest time stamp24; so that it is processed and removed first.25; RUN: %python -c 'import os,sys,time; t=time.time()-120; os.utime(sys.argv[1],(t,t))' %t.cache/llvmcache-foo26 27; This should remove it.28; RUN: wasm-ld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=32k:prune_interval=0s -o %t.wasm %t2.o %t.o29; RUN: ls %t.cache | count 430 31; Setting max number of files to 0 should disable the limit, not delete everything.32; RUN: wasm-ld --thinlto-cache-dir=%t.cache --thinlto-cache-policy prune_after=0s:cache_size=0%:cache_size_files=0:prune_interval=0s -o %t.wasm %t2.o %t.o33; RUN: ls %t.cache | count 434 35; Delete everything except for the timestamp, "foo" and one cache file.36; RUN: wasm-ld --thinlto-cache-dir=%t.cache --thinlto-cache-policy prune_after=0s:cache_size=0%:cache_size_files=1:prune_interval=0s -o %t.wasm %t2.o %t.o37; RUN: ls %t.cache | count 338 39target triple = "wasm32-unknown-unknown-wasm"40 41define void @globalfunc() #0 {42entry:43  ret void44}45