2016-10-08 12:44:23 +08:00
|
|
|
; Verify first that *without* hash, we don't use the cache.
|
|
|
|
|
2016-05-14 13:16:41 +08:00
|
|
|
; RUN: opt -module-summary %s -o %t.bc
|
2016-08-24 05:30:12 +08:00
|
|
|
; RUN: opt -module-summary %p/Inputs/cache.ll -o %t2.bc
|
2016-05-14 13:16:41 +08:00
|
|
|
|
2016-10-08 12:44:23 +08:00
|
|
|
; Verify that enabling caching is ignoring module without hash
|
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
2017-12-19 22:42:38 +08:00
|
|
|
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache
|
2016-10-08 12:44:23 +08:00
|
|
|
; RUN: ls %t.cache/llvmcache.timestamp
|
|
|
|
; RUN: ls %t.cache | count 1
|
|
|
|
|
|
|
|
; Verify that enabling caching is ignoring module without hash with llvm-lto2
|
2017-03-02 10:02:38 +08:00
|
|
|
; RUN: rm -Rf %t.cache
|
2017-04-12 02:12:00 +08:00
|
|
|
; RUN: llvm-lto2 run -o %t.o %t2.bc %t.bc -cache-dir %t.cache \
|
2016-10-08 12:44:23 +08:00
|
|
|
; RUN: -r=%t2.bc,_main,plx \
|
|
|
|
; RUN: -r=%t2.bc,_globalfunc,lx \
|
|
|
|
; RUN: -r=%t.bc,_globalfunc,plx
|
|
|
|
; RUN: ls %t.cache | count 0
|
|
|
|
|
|
|
|
|
|
|
|
; Repeat again, *with* hash this time.
|
|
|
|
|
|
|
|
; RUN: opt -module-hash -module-summary %s -o %t.bc
|
|
|
|
; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.bc
|
|
|
|
|
2017-03-21 00:41:57 +08:00
|
|
|
; Verify that enabling caching is working, and that the pruner only removes
|
|
|
|
; files matching the pattern "llvmcache-*".
|
2016-05-14 13:16:41 +08:00
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
2017-03-21 00:41:57 +08:00
|
|
|
; RUN: touch -t 197001011200 %t.cache/llvmcache-foo %t.cache/foo
|
2017-12-19 22:42:38 +08:00
|
|
|
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache
|
2017-03-21 00:41:57 +08:00
|
|
|
; RUN: ls %t.cache | count 4
|
2016-05-14 13:16:41 +08:00
|
|
|
; RUN: ls %t.cache/llvmcache.timestamp
|
2017-03-21 00:41:57 +08:00
|
|
|
; RUN: ls %t.cache/foo
|
|
|
|
; RUN: not ls %t.cache/llvmcache-foo
|
|
|
|
; RUN: ls %t.cache/llvmcache-* | count 2
|
2016-05-14 13:16:41 +08:00
|
|
|
|
2016-08-24 05:30:12 +08:00
|
|
|
; Verify that enabling caching is working with llvm-lto2
|
2017-03-02 10:02:38 +08:00
|
|
|
; RUN: rm -Rf %t.cache
|
2017-12-19 22:42:38 +08:00
|
|
|
; RUN: llvm-lto2 run -o %t.o %t2.bc %t.bc -cache-dir %t.cache \
|
2016-08-24 05:30:12 +08:00
|
|
|
; RUN: -r=%t2.bc,_main,plx \
|
|
|
|
; RUN: -r=%t2.bc,_globalfunc,lx \
|
|
|
|
; RUN: -r=%t.bc,_globalfunc,plx
|
|
|
|
; RUN: ls %t.cache | count 2
|
2017-03-21 00:41:57 +08:00
|
|
|
; RUN: ls %t.cache/llvmcache-* | count 2
|
2016-08-24 05:30:12 +08:00
|
|
|
|
2017-12-19 22:42:38 +08:00
|
|
|
; Verify that caches with a timestamp older than the pruning interval
|
|
|
|
; will be pruned
|
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
|
|
|
; RUN: touch -t 197001011200 %t.cache/llvmcache-foo
|
|
|
|
; RUN: touch -t 197001011200 %t.cache/llvmcache.timestamp
|
|
|
|
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache
|
|
|
|
; RUN: not ls %t.cache/llvmcache-foo
|
|
|
|
|
|
|
|
; Verify that specifying a negative number for the pruning interval
|
|
|
|
; effectively disables the pruning
|
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
|
|
|
; RUN: touch -t 197001011200 %t.cache/llvmcache-foo
|
|
|
|
; RUN: touch -t 197001011200 %t.cache/llvmcache.timestamp
|
|
|
|
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache --thinlto-cache-pruning-interval -1
|
|
|
|
; RUN: ls %t.cache/llvmcache-foo
|
|
|
|
|
2018-02-16 07:29:21 +08:00
|
|
|
; Verify that the pruner doesn't run and a cache file is not deleted when:
|
|
|
|
; default values for pruning interval and cache expiration are used,
|
|
|
|
; llvmcache.timestamp is current,
|
|
|
|
; cache file is older than default cache expiration value.
|
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
|
|
|
; RUN: touch -t 197001011200 %t.cache/llvmcache-foo
|
|
|
|
; RUN: touch %t.cache/llvmcache.timestamp
|
|
|
|
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache
|
|
|
|
; RUN: ls %t.cache/llvmcache-foo
|
|
|
|
|
|
|
|
; Verify that the pruner runs and a cache file is deleted when:
|
|
|
|
; pruning interval has value 0 (i.e. run garbage collector now)
|
|
|
|
; default value for cache expiration is used,
|
|
|
|
; llvmcache.timestamp is current,
|
|
|
|
; cache file is older than default cache expiration value.
|
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
|
|
|
; RUN: touch -t 197001011200 %t.cache/llvmcache-foo
|
|
|
|
; RUN: touch %t.cache/llvmcache.timestamp
|
|
|
|
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache --thinlto-cache-pruning-interval 0
|
|
|
|
; RUN: not ls %t.cache/llvmcache-foo
|
|
|
|
|
2018-07-04 22:17:10 +08:00
|
|
|
; Populate the cache with files with "old" access times, then check llvm-lto updates these file times
|
|
|
|
; A negative pruning interval is used to avoid removing cache entries
|
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
|
|
|
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache
|
|
|
|
; RUN: touch -a -t 197001011200 %t.cache/llvmcache-*
|
|
|
|
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache --thinlto-cache-pruning-interval -1
|
|
|
|
; RUN: ls -ltu %t.cache/* | not grep 1970-01-01
|
|
|
|
|
|
|
|
; Populate the cache with files with "old" access times, then check llvm-lto2 updates these file times
|
|
|
|
; RUN: rm -Rf %t.cache
|
|
|
|
; RUN: llvm-lto2 run -o %t.o %t2.bc %t.bc -cache-dir %t.cache \
|
|
|
|
; RUN: -r=%t2.bc,_main,plx \
|
|
|
|
; RUN: -r=%t2.bc,_globalfunc,lx \
|
|
|
|
; RUN: -r=%t.bc,_globalfunc,plx
|
|
|
|
; RUN: touch -a -t 197001011200 %t.cache/llvmcache-*
|
|
|
|
; RUN: llvm-lto2 run -o %t.o %t2.bc %t.bc -cache-dir %t.cache \
|
|
|
|
; RUN: -r=%t2.bc,_main,plx \
|
|
|
|
; RUN: -r=%t2.bc,_globalfunc,lx \
|
|
|
|
; RUN: -r=%t.bc,_globalfunc,plx
|
|
|
|
; RUN: ls -ltu %t.cache/* | not grep 1970-01-01
|
|
|
|
|
2018-03-02 11:51:27 +08:00
|
|
|
; Verify that specifying max size for the cache directory prunes it to this
|
|
|
|
; size, removing the largest files first.
|
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
|
|
|
; Create cache files with different sizes.
|
|
|
|
; Only 8B, 16B and 76B files should stay after pruning.
|
[lit, python] Always add quotes around the python path in lit
Summary:
The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes.
This change updates several configuration files which specify the path to python as a substitution and also remove quotes from existing tests.
Reviewers: asmith, zturner, alexshap, jakehehrlich
Reviewed By: zturner, alexshap, jakehehrlich
Subscribers: mehdi_amini, nemanjai, eraman, kbarton, jakehehrlich, steven_wu, dexonsmith, stella.stamenova, delcypher, llvm-commits
Differential Revision: https://reviews.llvm.org/D50206
llvm-svn: 339073
2018-08-07 06:37:44 +08:00
|
|
|
; RUN: %python -c "with open(r'%t.cache/llvmcache-foo-1024', 'w') as file: file.truncate(1024)"
|
|
|
|
; RUN: %python -c "with open(r'%t.cache/llvmcache-foo-16', 'w') as file: file.truncate(16)"
|
|
|
|
; RUN: %python -c "with open(r'%t.cache/llvmcache-foo-8', 'w') as file: file.truncate(8)"
|
|
|
|
; RUN: %python -c "with open(r'%t.cache/llvmcache-foo-76', 'w') as file: file.truncate(76)"
|
|
|
|
; RUN: %python -c "with open(r'%t.cache/llvmcache-foo-77', 'w') as file: file.truncate(77)"
|
2018-03-02 11:51:27 +08:00
|
|
|
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache --thinlto-cache-max-size-bytes 100
|
|
|
|
; RUN: ls %t.cache/llvmcache-foo-16
|
|
|
|
; RUN: ls %t.cache/llvmcache-foo-8
|
|
|
|
; RUN: ls %t.cache/llvmcache-foo-76
|
|
|
|
; RUN: not ls %t.cache/llvmcache-foo-1024
|
|
|
|
; RUN: not ls %t.cache/llvmcache-foo-77
|
|
|
|
|
|
|
|
; Verify that specifying max number of files in the cache directory prunes
|
|
|
|
; it to this amount, removing the largest files first.
|
|
|
|
; RUN: rm -Rf %t.cache && mkdir %t.cache
|
|
|
|
; Create cache files with different sizes.
|
|
|
|
; Only 8B and 16B files should stay after pruning.
|
[lit, python] Always add quotes around the python path in lit
Summary:
The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes.
This change updates several configuration files which specify the path to python as a substitution and also remove quotes from existing tests.
Reviewers: asmith, zturner, alexshap, jakehehrlich
Reviewed By: zturner, alexshap, jakehehrlich
Subscribers: mehdi_amini, nemanjai, eraman, kbarton, jakehehrlich, steven_wu, dexonsmith, stella.stamenova, delcypher, llvm-commits
Differential Revision: https://reviews.llvm.org/D50206
llvm-svn: 339073
2018-08-07 06:37:44 +08:00
|
|
|
; RUN: %python -c "print(' ' * 1023)" > %t.cache/llvmcache-foo-1024
|
|
|
|
; RUN: %python -c "print(' ' * 15)" > %t.cache/llvmcache-foo-16
|
|
|
|
; RUN: %python -c "print(' ' * 7)" > %t.cache/llvmcache-foo-8
|
|
|
|
; RUN: %python -c "print(' ' * 75)" > %t.cache/llvmcache-foo-76
|
|
|
|
; RUN: %python -c "print(' ' * 76)" > %t.cache/llvmcache-foo-77
|
2018-03-02 11:51:27 +08:00
|
|
|
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache --thinlto-cache-max-size-files 2
|
|
|
|
; RUN: ls %t.cache/llvmcache-foo-16
|
|
|
|
; RUN: ls %t.cache/llvmcache-foo-8
|
|
|
|
; RUN: not ls %t.cache/llvmcache-foo-76
|
|
|
|
; RUN: not ls %t.cache/llvmcache-foo-1024
|
|
|
|
; RUN: not ls %t.cache/llvmcache-foo-77
|
|
|
|
|
2016-05-14 13:16:41 +08:00
|
|
|
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-apple-macosx10.11.0"
|
|
|
|
|
|
|
|
define void @globalfunc() #0 {
|
|
|
|
entry:
|
|
|
|
ret void
|
|
|
|
}
|