brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.4 KiB · 711d18e Raw
50 lines · plain
1; REQUIRES: x862; UNSUPPORTED: main-run-twice3 4; RUN: opt -module-hash -module-summary %s -o %t.o5; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.o6 7; RUN: rm -rf %t && mkdir %t8 9;; Check cache policies of the number of files.10;; Case 1: A value of 0 disables the number of files based pruning. Therefore, there is no warning.11; RUN: ld.lld --verbose --thinlto-cache-dir=%t --thinlto-cache-policy=prune_interval=0s:cache_size_files=0 %t2.o %t.o -o %t3 2>&1 | FileCheck %s --implicit-check-not=warning:12;; Case 2: If the total number of the files created by the current link job is less than the maximum number of files, there is no warning.13; RUN: ld.lld --verbose --thinlto-cache-dir=%t --thinlto-cache-policy=prune_interval=0s:cache_size_files=3 %t2.o %t.o -o %t3 2>&1 | FileCheck %s --implicit-check-not=warning:14;; Case 3: If the total number of the files created by the current link job exceeds the maximum number of files, a warning is given.15; RUN: ld.lld --thinlto-cache-dir=%t --thinlto-cache-policy=prune_interval=0s:cache_size_files=1 %t2.o %t.o -o %t3 2>&1 | FileCheck %s --check-prefixes=NUM,WARN16 17;; Check cache policies of the cache size.18;; Case 1: A value of 0 disables the absolute size-based pruning. Therefore, there is no warning.19; RUN: ld.lld --verbose --thinlto-cache-dir=%t --thinlto-cache-policy=prune_interval=0s:cache_size_bytes=0 %t2.o %t.o -o %t3 2>&1 | FileCheck %s --implicit-check-not=warning:20 21;; Get the total size of created cache files.22; RUN: rm -rf %t && mkdir %t && cd %t23; RUN: ld.lld --thinlto-cache-dir=%t --thinlto-cache-policy=prune_interval=0s:cache_size_bytes=32k %t2.o %t.o -o %t3 2>&124; RUN: %python -c "import os, sys; size=sum(os.path.getsize(filename) for filename in os.listdir('.') if os.path.isfile(filename) and filename.startswith('llvmcache-')); print(size+5); print(size-5)" > %t.size.txt25 26;; Case 2: If the total size of the cache files created by the current link job is less than the maximum size for the cache directory in bytes, there is no warning.27; RUN: echo -n "--thinlto-cache-policy=prune_interval=0s:cache_size_bytes=" > %t.response28; RUN: head -1 %t.size.txt >> %t.response29; RUN: ld.lld --verbose --thinlto-cache-dir=%t @%t.response %t2.o %t.o -o %t3 2>&1 | FileCheck %s --implicit-check-not=warning:30 31;; Case 3: If the total size of the cache files created by the current link job exceeds the maximum size for the cache directory in bytes, a warning is given.32; RUN: echo -n "--thinlto-cache-policy=prune_interval=0s:cache_size_bytes=" > %t.response33; RUN: tail -1 %t.size.txt >> %t.response34; RUN: ld.lld --verbose --thinlto-cache-dir=%t @%t.response %t2.o %t.o -o %t3 2>&1 | FileCheck %s --check-prefixes=SIZE,WARN35 36;; Check emit two warnings if pruning happens due to reach both the size and number limits.37; RUN: ld.lld --thinlto-cache-dir=%t --thinlto-cache-policy=prune_interval=0s:cache_size_files=1:cache_size_bytes=1 %t2.o %t.o -o %t3 2>&1 | FileCheck %s --check-prefixes=NUM,SIZE,WARN38 39; NUM: warning: ThinLTO cache pruning happens since the number of{{.*}}--thinlto-cache-policy40; SIZE: warning: ThinLTO cache pruning happens since the total size of{{.*}}--thinlto-cache-policy41; WARN-NOT: warning: ThinLTO cache pruning happens{{.*}}--thinlto-cache-policy42 43target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"44target triple = "x86_64-unknown-linux-gnu"45 46define void @globalfunc() {47entry:48  ret void49}50