[ThinLTO]Expose cache entry expiration time option in llvm-lto and fix a test
authorJames Henderson <jh7370@my.bristol.ac.uk>
Wed, 3 Oct 2018 13:00:20 +0000 (13:00 +0000)
committerJames Henderson <jh7370@my.bristol.ac.uk>
Wed, 3 Oct 2018 13:00:20 +0000 (13:00 +0000)
commit99031b79a678fbd685defce0e61696ba04f45f25
tree08351ebca1896c05e56dcc39026f975f63a9b395
parentfb3a97bec033e1b8243404678e0149c4c268ef41
[ThinLTO]Expose cache entry expiration time option in llvm-lto and fix a test

Two cases in a ThinLTO test were passing for the wrong reasons, since
rL340374. The tests were supposed to be testing that files were being
pruned due to the cache size, but they were in fact being pruned because
they were older than the default expiration period of 1 week.

This change fixes the tests by explicitly setting the expiration time to
the maximum value. This required the option to be exposed in llvm-lto.

By assigning all files in the cache a similar time, it is possible to see
that the newest files are still being kept, and that we aren't passing
for the wrong reason again. In the event that the entry expiration were
to expire for them, then the test would start failing, because these
files would be removed too.

Reviewed by: rnk, inglorion

Differential Revision: https://reviews.llvm.org/D51992

llvm-svn: 343687
llvm/test/ThinLTO/X86/cache.ll
llvm/tools/llvm-lto/llvm-lto.cpp