80 lines · plain
1; Verify that enabling caching is ignoring module when we emit them without hash.2; RUN: opt -module-summary %s -o %t.o3; RUN: opt -module-summary %p/Inputs/cache.ll -o %t2.o4 5; RUN: rm -Rf %t.cache6; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \7; RUN: --plugin-opt=thinlto \8; RUN: --plugin-opt=cache-dir=%t.cache \9; RUN: -o %t3.o %t2.o %t.o10 11; Since nothing was added to the cache, there shouldn't be a timestamp file yet.12; RUN: not ls %t.cache13 14 15; Verify that enabling caching is working with module with hash.16 17; RUN: opt -module-hash -module-summary %s -o %t.o18; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.o19 20; RUN: rm -Rf %t.cache21; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \22; RUN: --plugin-opt=thinlto \23; RUN: --plugin-opt=cache-dir=%t.cache \24; RUN: -o %t3.o %t2.o %t.o25 26; Two cached objects, plus a timestamp file27; RUN: ls %t.cache | count 328 29 30; Create two files that would be removed by cache pruning due to age.31; We should only remove files matching the pattern "llvmcache-*".32 33; RUN: touch -t 197001011200 %t.cache/llvmcache-foo %t.cache/foo34; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \35; RUN: --plugin-opt=thinlto \36; RUN: --plugin-opt=cache-dir=%t.cache \37; RUN: --plugin-opt=cache-policy=prune_after=1h:prune_interval=0s \38; RUN: -o %t3.o %t2.o %t.o39 40; Two cached objects, plus a timestamp file and "foo", minus the file we removed.41; RUN: ls %t.cache | count 442 43 44; Create a file of size 64KB.45; RUN: %python -c "print(' ' * 65536)" > %t.cache/llvmcache-foo46 47; This should leave the file in place.48; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \49; RUN: --plugin-opt=thinlto \50; RUN: --plugin-opt=cache-dir=%t.cache \51; RUN: --plugin-opt=cache-policy=cache_size_bytes=128k:prune_interval=0s \52; RUN: -o %t3.o %t2.o %t.o53; RUN: ls %t.cache | count 554 55 56; Increase the age of llvmcache-foo57; RUN: touch -r %t.cache/llvmcache-foo -d '-2 minutes' %t.cache/llvmcache-foo58 59; This should remove it.60; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \61; RUN: --plugin-opt=thinlto \62; RUN: --plugin-opt=save-temps \63; RUN: --plugin-opt=cache-dir=%t.cache \64; RUN: --plugin-opt=cache-policy=cache_size_bytes=32k:prune_interval=0s \65; RUN: -o %t4.o %t2.o %t.o66; RUN: ls %t.cache | count 467; With save-temps we can confirm that the cached files were copied into temp68; files to avoid a race condition with the cached files being pruned, since the69; gold plugin-api only accepts native objects passed back as files.70; RUN: ls %t4.o.lto.o1 %t4.o.lto.o271 72 73target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"74target triple = "x86_64-unknown-linux-gnu"75 76define void @globalfunc() #0 {77entry:78 ret void79}80