blob: d654d3468e3e15167afa2e2a69ecdc76d3cc748b [file] [log] [blame]
Mehdi Aminif82bda02016-10-08 04:44:23 +00001; Verify first that *without* hash, we don't use the cache.
2
Mehdi Aminiab4a8b62016-05-14 05:16:41 +00003; RUN: opt -module-summary %s -o %t.bc
Mehdi Aminiadc0e262016-08-23 21:30:12 +00004; RUN: opt -module-summary %p/Inputs/cache.ll -o %t2.bc
Mehdi Aminiab4a8b62016-05-14 05:16:41 +00005
Mehdi Aminif82bda02016-10-08 04:44:23 +00006; Verify that enabling caching is ignoring module without hash
7; RUN: rm -Rf %t.cache && mkdir %t.cache
8; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache
9; RUN: ls %t.cache/llvmcache.timestamp
10; RUN: ls %t.cache | count 1
11
12; Verify that enabling caching is ignoring module without hash with llvm-lto2
Peter Collingbourneab76a192017-03-02 02:02:38 +000013; RUN: rm -Rf %t.cache
Mehdi Aminif82bda02016-10-08 04:44:23 +000014; RUN: llvm-lto2 -o %t.o %t2.bc %t.bc -cache-dir %t.cache \
15; RUN: -r=%t2.bc,_main,plx \
16; RUN: -r=%t2.bc,_globalfunc,lx \
17; RUN: -r=%t.bc,_globalfunc,plx
18; RUN: ls %t.cache | count 0
19
20
21; Repeat again, *with* hash this time.
22
23; RUN: opt -module-hash -module-summary %s -o %t.bc
24; RUN: opt -module-hash -module-summary %p/Inputs/cache.ll -o %t2.bc
25
Mehdi Aminiab4a8b62016-05-14 05:16:41 +000026; Verify that enabling caching is working
27; RUN: rm -Rf %t.cache && mkdir %t.cache
28; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache
29; RUN: ls %t.cache/llvmcache.timestamp
30; RUN: ls %t.cache | count 3
31
Mehdi Aminiadc0e262016-08-23 21:30:12 +000032; Verify that enabling caching is working with llvm-lto2
Peter Collingbourneab76a192017-03-02 02:02:38 +000033; RUN: rm -Rf %t.cache
Mehdi Aminiadc0e262016-08-23 21:30:12 +000034; RUN: llvm-lto2 -o %t.o %t2.bc %t.bc -cache-dir %t.cache \
35; RUN: -r=%t2.bc,_main,plx \
36; RUN: -r=%t2.bc,_globalfunc,lx \
37; RUN: -r=%t.bc,_globalfunc,plx
38; RUN: ls %t.cache | count 2
39
Mehdi Aminiab4a8b62016-05-14 05:16:41 +000040target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
41target triple = "x86_64-apple-macosx10.11.0"
42
43define void @globalfunc() #0 {
44entry:
45 ret void
46}