llvm-project/lld/test/wasm
Fangrui Song 7bafaf8ffe Reland "Change the timestamp of llvmcache-foo file to meet the thinLTO prune policy"
Summary:
It is difficult to touch a file with a relative mtime across different OSes as POSIX touch -d is rigid. While we may construct relative timestamps with `date`, POSIX date is inadequate to do so as various OSes' date do not agree on a common format (OpenBSD uses `date -r seconds`, FreeBSD uses `date -v-2M` while GNU accepts `-d '-2 min'`)

Just use python os.utime()

Original description:

    The case may randomly fail if we test it with command "
     while llvm-lit tools/lld/test/ELF/lto/cache.ll; do true; done". It is because the llvmcache-foo file is younger than llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6. But due to timestamp precision reason their timestamp is the same. Given the same timestamp, the file prune policy is to remove bigger size file first, so mostly foo file is removed for its bigger size. And the files size is under threshold after deleting foo file. That's what test case expect.

    However sometimes, the precision is enough to measure that timestamp of llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6 are smaller than foo, so llvmcache-349F039B8EB076D412007D82778442BED3148C4E and llvmcache-A8107945C65C2B2BBEE8E61AA604C311D60D58D6 are deleted first. Since the files size is still above the file size threshold after deleting the 2 files, the foo file is also deleted. And then the test case fails, because it expect only one file should be deleted instead of 3.

    The fix is to change the timestamp of llvmcache-foo file to meet the thinLTO prune policy.
    The same fix is applied to llvm code at https://reviews.llvm.org/D52452.

    Patch by Luo Yuanke.

Reviewers: ruiu, craig.topper, smaslov, Jianping, espindola, LuoYuanke, tejohnson

Reviewed By: tejohnson

Subscribers: sbc100, krytarowski, aheejin, llvm-commits, dexonsmith, steven_wu, arichardson, inglorion, emaste, bjope, rupprecht

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

llvm-svn: 346006
2018-11-02 17:44:30 +00:00
..
Inputs [WebAssembly] Fix archive member display in error messages 2018-07-18 21:46:09 +00:00
lto Reland "Change the timestamp of llvmcache-foo file to meet the thinLTO prune policy" 2018-11-02 17:44:30 +00:00
alias.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
archive-export.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
archive.ll [lld] Make tests calling llvm-ar more robust 2018-08-02 11:33:54 +00:00
call-indirect.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
comdats.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
compress-relocs.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
conflict.test [WebAssembly] Check function signatures by default 2018-05-05 01:23:07 +00:00
custom-sections.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
cxx-mangling.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
data-layout.ll [WebAssembly] Allow signautre of entry function to be flexible 2018-05-14 23:01:16 +00:00
data-segment-merging.ll [WebAssembly] Group rodata into a single output segment 2018-08-08 18:02:55 +00:00
debug-removed-fn.ll [WebAssembly] Move .debug_line section address of dead function outside section range 2018-09-24 23:50:55 +00:00
debuginfo.test [WebAssembly] Fix crash when relocation synbol is not live 2018-05-23 01:38:00 +00:00
demangle.ll [WebAssembly] Don't error when --undefined symbols are not found 2018-08-04 00:04:06 +00:00
driver.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
entry-signature.ll [WebAssembly] Allow signautre of entry function to be flexible 2018-05-14 23:01:16 +00:00
entry.ll [WebAssembly] Allow signautre of entry function to be flexible 2018-05-14 23:01:16 +00:00
export-all.ll [WebAssembly] Don't error when --undefined symbols are not found 2018-08-04 00:04:06 +00:00
export-table.test [WebAssembly] Check function signatures by default 2018-05-05 01:23:07 +00:00
export.ll [WebAssembly] Don't error when --undefined symbols are not found 2018-08-04 00:04:06 +00:00
fatal-warnings.ll Revert "[WebAssembly] Error on mismatched function signature in final output" 2018-06-22 15:13:10 +00:00
function-imports-first.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
function-imports.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
function-index.test [WebAssembly] Check function signatures by default 2018-05-05 01:23:07 +00:00
gc-imports.ll [WebAssembly] Only mark non-hidden symbols as live if they are also defined 2018-06-21 15:00:00 +00:00
gc-sections.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
import-memory.test [WebAssembly] Check function signatures by default 2018-05-05 01:23:07 +00:00
import-table.test [WebAssembly] Check function signatures by default 2018-05-05 01:23:07 +00:00
init-fini.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
invalid-stack-size.test [WebAssembly] Check function signatures by default 2018-05-05 01:23:07 +00:00
lit.local.cfg
load-undefined.test [WebAssembly] Don't error when --undefined symbols are not found 2018-08-04 00:04:06 +00:00
local-symbols.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
locals-duplicate.test [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
many-functions.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
reloc-addend.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
relocatable.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
responsefile.test Fix wasm responsefile lld test on Windows 2018-06-14 19:59:22 +00:00
signature-mismatch-weak.ll [WebAssembly] Remove duplicate function. NFC. 2018-11-01 01:08:37 +00:00
signature-mismatch.ll [WebAssembly] Remove duplicate function. NFC. 2018-11-01 01:08:37 +00:00
stack-first.test [WebAssembly] Check function signatures by default 2018-05-05 01:23:07 +00:00
stack-pointer.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
strip-all.test [WedAssembly] Add -s and -S alias for --strip-all and --strip-debug 2018-10-31 19:30:43 +00:00
strip-debug.test [WedAssembly] Add -s and -S alias for --strip-all and --strip-debug 2018-10-31 19:30:43 +00:00
symbol-type-mismatch.ll [WebAssembly] Update to match llvm changes 2018-05-14 22:42:33 +00:00
undefined-entry.test [WebAssembly] Don't error when --undefined symbols are not found 2018-08-04 00:04:06 +00:00
undefined-weak-call.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
undefined.ll [WebAssembly] Don't error when --undefined symbols are not found 2018-08-04 00:04:06 +00:00
version.ll [WebAssembly] Remove final -wasm component of target triple. NFC. 2018-05-10 17:59:41 +00:00
visibility-hidden.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
weak-alias-overide.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
weak-alias.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
weak-symbols.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
weak-undefined.ll [WebAssembly] Add --[no]-export-dynamic to replace --export-default 2018-09-27 21:06:25 +00:00
whole-archive.test [WebAssembly] Add support for --whole-archive. 2018-07-23 23:51:19 +00:00