|
80 | 80 | ; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache --thinlto-cache-pruning-interval 0
|
81 | 81 | ; RUN: not ls %t.cache/llvmcache-foo
|
82 | 82 |
|
| 83 | +; Verify that specifying max size for the cache directory prunes it to this |
| 84 | +; size, removing the largest files first. |
| 85 | +; RUN: rm -Rf %t.cache && mkdir %t.cache |
| 86 | +; Create cache files with different sizes. |
| 87 | +; Only 8B, 16B and 76B files should stay after pruning. |
| 88 | +; RUN: %python -c "print(' ' * 1023)" > %t.cache/llvmcache-foo-1024 |
| 89 | +; RUN: %python -c "print(' ' * 15)" > %t.cache/llvmcache-foo-16 |
| 90 | +; RUN: %python -c "print(' ' * 7)" > %t.cache/llvmcache-foo-8 |
| 91 | +; RUN: %python -c "print(' ' * 75)" > %t.cache/llvmcache-foo-76 |
| 92 | +; RUN: %python -c "print(' ' * 76)" > %t.cache/llvmcache-foo-77 |
| 93 | +; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache --thinlto-cache-max-size-bytes 100 |
| 94 | +; RUN: ls %t.cache/llvmcache-foo-16 |
| 95 | +; RUN: ls %t.cache/llvmcache-foo-8 |
| 96 | +; RUN: ls %t.cache/llvmcache-foo-76 |
| 97 | +; RUN: not ls %t.cache/llvmcache-foo-1024 |
| 98 | +; RUN: not ls %t.cache/llvmcache-foo-77 |
| 99 | + |
| 100 | +; Verify that specifying max number of files in the cache directory prunes |
| 101 | +; it to this amount, removing the largest files first. |
| 102 | +; RUN: rm -Rf %t.cache && mkdir %t.cache |
| 103 | +; Create cache files with different sizes. |
| 104 | +; Only 8B and 16B files should stay after pruning. |
| 105 | +; RUN: %python -c "print(' ' * 1023)" > %t.cache/llvmcache-foo-1024 |
| 106 | +; RUN: %python -c "print(' ' * 15)" > %t.cache/llvmcache-foo-16 |
| 107 | +; RUN: %python -c "print(' ' * 7)" > %t.cache/llvmcache-foo-8 |
| 108 | +; RUN: %python -c "print(' ' * 75)" > %t.cache/llvmcache-foo-76 |
| 109 | +; RUN: %python -c "print(' ' * 76)" > %t.cache/llvmcache-foo-77 |
| 110 | +; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache --thinlto-cache-max-size-files 2 |
| 111 | +; RUN: ls %t.cache/llvmcache-foo-16 |
| 112 | +; RUN: ls %t.cache/llvmcache-foo-8 |
| 113 | +; RUN: not ls %t.cache/llvmcache-foo-76 |
| 114 | +; RUN: not ls %t.cache/llvmcache-foo-1024 |
| 115 | +; RUN: not ls %t.cache/llvmcache-foo-77 |
| 116 | + |
83 | 117 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
|
84 | 118 | target triple = "x86_64-apple-macosx10.11.0"
|
85 | 119 |
|
|
0 commit comments