Mehdi Amini | f82bda0 | 2016-10-08 04:44:23 +0000 | [diff] [blame] | 1 | ; Verify first that *without* hash, we don't use the cache. |
| 2 | |
Mehdi Amini | ab4a8b6 | 2016-05-14 05:16:41 +0000 | [diff] [blame] | 3 | ; RUN: opt -module-summary %s -o %t.bc |
Mehdi Amini | adc0e26 | 2016-08-23 21:30:12 +0000 | [diff] [blame] | 4 | ; RUN: opt -module-summary %p/Inputs/cache.ll -o %t2.bc |
Mehdi Amini | ab4a8b6 | 2016-05-14 05:16:41 +0000 | [diff] [blame] | 5 | |
Mehdi Amini | f82bda0 | 2016-10-08 04:44:23 +0000 | [diff] [blame] | 6 | ; 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 Collingbourne | ab76a19 | 2017-03-02 02:02:38 +0000 | [diff] [blame] | 13 | ; RUN: rm -Rf %t.cache |
Peter Collingbourne | 7faa60c | 2017-04-11 18:12:00 +0000 | [diff] [blame^] | 14 | ; RUN: llvm-lto2 run -o %t.o %t2.bc %t.bc -cache-dir %t.cache \ |
Mehdi Amini | f82bda0 | 2016-10-08 04:44:23 +0000 | [diff] [blame] | 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 | |
Peter Collingbourne | 25a17ba | 2017-03-20 16:41:57 +0000 | [diff] [blame] | 26 | ; Verify that enabling caching is working, and that the pruner only removes |
| 27 | ; files matching the pattern "llvmcache-*". |
Mehdi Amini | ab4a8b6 | 2016-05-14 05:16:41 +0000 | [diff] [blame] | 28 | ; RUN: rm -Rf %t.cache && mkdir %t.cache |
Peter Collingbourne | 25a17ba | 2017-03-20 16:41:57 +0000 | [diff] [blame] | 29 | ; RUN: touch -t 197001011200 %t.cache/llvmcache-foo %t.cache/foo |
Mehdi Amini | ab4a8b6 | 2016-05-14 05:16:41 +0000 | [diff] [blame] | 30 | ; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache |
Peter Collingbourne | 25a17ba | 2017-03-20 16:41:57 +0000 | [diff] [blame] | 31 | ; RUN: ls %t.cache | count 4 |
Mehdi Amini | ab4a8b6 | 2016-05-14 05:16:41 +0000 | [diff] [blame] | 32 | ; RUN: ls %t.cache/llvmcache.timestamp |
Peter Collingbourne | 25a17ba | 2017-03-20 16:41:57 +0000 | [diff] [blame] | 33 | ; RUN: ls %t.cache/foo |
| 34 | ; RUN: not ls %t.cache/llvmcache-foo |
| 35 | ; RUN: ls %t.cache/llvmcache-* | count 2 |
Mehdi Amini | ab4a8b6 | 2016-05-14 05:16:41 +0000 | [diff] [blame] | 36 | |
Mehdi Amini | adc0e26 | 2016-08-23 21:30:12 +0000 | [diff] [blame] | 37 | ; Verify that enabling caching is working with llvm-lto2 |
Peter Collingbourne | ab76a19 | 2017-03-02 02:02:38 +0000 | [diff] [blame] | 38 | ; RUN: rm -Rf %t.cache |
Peter Collingbourne | 7faa60c | 2017-04-11 18:12:00 +0000 | [diff] [blame^] | 39 | ; RUN: llvm-lto2 run -o %t.o %t2.bc %t.bc -cache-dir %t.cache \ |
Mehdi Amini | adc0e26 | 2016-08-23 21:30:12 +0000 | [diff] [blame] | 40 | ; RUN: -r=%t2.bc,_main,plx \ |
| 41 | ; RUN: -r=%t2.bc,_globalfunc,lx \ |
| 42 | ; RUN: -r=%t.bc,_globalfunc,plx |
| 43 | ; RUN: ls %t.cache | count 2 |
Peter Collingbourne | 25a17ba | 2017-03-20 16:41:57 +0000 | [diff] [blame] | 44 | ; RUN: ls %t.cache/llvmcache-* | count 2 |
Mehdi Amini | adc0e26 | 2016-08-23 21:30:12 +0000 | [diff] [blame] | 45 | |
Mehdi Amini | ab4a8b6 | 2016-05-14 05:16:41 +0000 | [diff] [blame] | 46 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 47 | target triple = "x86_64-apple-macosx10.11.0" |
| 48 | |
| 49 | define void @globalfunc() #0 { |
| 50 | entry: |
| 51 | ret void |
| 52 | } |