xref: /llvm-project/llvm/test/ThinLTO/X86/cache-decoupled-from-filenames.ll (revision bacb45eb9a776c032f69d55a561fa450ba545c57)
1; RUN: rm -rf %t && mkdir -p %t/1 %t/2 %t/3 %t/4
2; RUN: opt -module-hash -module-summary %s -o %t/t.bc
3; RUN: opt -module-hash -module-summary %S/Inputs/cache-import-lists1.ll -o %t/1/a.bc
4; RUN: opt -module-hash -module-summary %S/Inputs/cache-import-lists2.ll -o %t/2/b.bc
5
6; Tests that the hash for t is insensitive to the bitcode module filenames.
7
8; RUN: rm -rf %t/cache
9; RUN: llvm-lto2 run -cache-dir %t/cache -o %t.o %t/t.bc %t/1/a.bc %t/2/b.bc -r=%t/t.bc,main,plx -r=%t/t.bc,f1,lx -r=%t/t.bc,f2,lx -r=%t/1/a.bc,f1,plx -r=%t/1/a.bc,linkonce_odr,plx -r=%t/2/b.bc,f2,plx -r=%t/2/b.bc,linkonce_odr,lx
10; RUN: ls %t/cache | count 3
11
12; RUN: cp %t/1/a.bc %t/4/d.bc
13; RUN: cp %t/2/b.bc %t/3/k.bc
14; RUN: llvm-lto2 run -cache-dir %t/cache -o %t.o %t/t.bc %t/4/d.bc %t/3/k.bc -r=%t/t.bc,main,plx -r=%t/t.bc,f1,lx -r=%t/t.bc,f2,lx -r=%t/4/d.bc,f1,plx -r=%t/4/d.bc,linkonce_odr,plx -r=%t/3/k.bc,f2,plx -r=%t/3/k.bc,linkonce_odr,lx
15; RUN: ls %t/cache | count 3
16
17target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
18target triple = "x86_64-unknown-linux-gnu"
19
20define void @main() {
21  call void @f1()
22  call void @f2()
23  ret void
24}
25
26declare void @f1()
27declare void @f2()
28