69 lines · plain
1; REQUIRES: x862; NetBSD: noatime mounts currently inhibit 'touch' from updating atime3; UNSUPPORTED: system-netbsd4 5; RUN: opt -module-hash -module-summary %s -o %t.o6; RUN: opt -module-hash -module-summary %p/Inputs/lto-cache.ll -o %t2.o7 8; RUN: rm -Rf %t.cache && mkdir %t.cache9; Create two files that would be removed by cache pruning due to age.10; We should only remove files matching "llvmcache-*" or "Thin-*".11; RUN: touch -t 197001011200 %t.cache/llvmcache-foo %t.cache/Thin-123.tmp.o %t.cache/foo12; RUN: lld-link /lldltocache:%t.cache /lldltocachepolicy:prune_after=1h /out:%t3 /entry:main %t2.o %t.o13 14; Two cached objects, plus a timestamp file and "foo", minus the file we removed.15; RUN: ls %t.cache | count 416 17;; Check that mllvm options participate in the cache key18; RUN: rm -rf %t.cache && mkdir %t.cache19; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o20; RUN: ls %t.cache | count 321; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-enable-ml-inliner=default22; RUN: ls %t.cache | count 523 24;; Adding another option resuls in 2 more cache entries25; RUN: rm -rf %t.cache && mkdir %t.cache26; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o27; RUN: ls %t.cache | count 328; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-enable-ml-inliner=default29; RUN: ls %t.cache | count 530; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-enable-ml-inliner=default /mllvm:-max-devirt-iterations=131; RUN: ls %t.cache | count 732 33;; Changing order may matter - e.g. if overriding /mllvm:options - so we get 2 more entries34; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-max-devirt-iterations=1 /mllvm:-enable-ml-inliner=default35; RUN: ls %t.cache | count 936 37;; Going back to a pre-cached order doesn't create more entries.38; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-enable-ml-inliner=default /mllvm:-max-devirt-iterations=139; RUN: ls %t.cache | count 940 41;; Different flag values matter42; RUN: rm -rf %t.cache && mkdir %t.cache43; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-enable-ml-inliner=default /mllvm:-max-devirt-iterations=244; RUN: ls %t.cache | count 345; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-enable-ml-inliner=default /mllvm:-max-devirt-iterations=146; RUN: ls %t.cache | count 547 48;; Same flag value passed to different flags matters, and switching the order49;; of the two flags matters.50; RUN: rm -rf %t.cache && mkdir %t.cache51; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-enable-ml-inliner=default52; RUN: ls %t.cache | count 353; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-emit-dwarf-unwind=default54; RUN: ls %t.cache | count 555; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-enable-ml-inliner=default56; RUN: ls %t.cache | count 557; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-enable-ml-inliner=default /mllvm:-emit-dwarf-unwind=default58; RUN: ls %t.cache | count 759; RUN: lld-link /lldltocache:%t.cache /entry:main /out:%t3 %t2.o %t.o /mllvm:-emit-dwarf-unwind=default /mllvm:-enable-ml-inliner=default60; RUN: ls %t.cache | count 961 62target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"63target triple = "x86_64-pc-windows-msvc"64 65define void @globalfunc() #0 {66entry:67 ret void68}69