xref: /llvm-project/llvm/test/ThinLTO/X86/cache-import-lists.ll (revision 7b1d793713cf9ed9ab719f33b332f9c66a1fc5cc)
154a52b75SPeter Collingbourne; RUN: opt -module-hash -module-summary %s -o %t.bc
254a52b75SPeter Collingbourne; RUN: opt -module-hash -module-summary %S/Inputs/cache-import-lists1.ll -o %t1.bc
354a52b75SPeter Collingbourne; RUN: opt -module-hash -module-summary %S/Inputs/cache-import-lists2.ll -o %t2.bc
454a52b75SPeter Collingbourne
554a52b75SPeter Collingbourne; Tests that the hash for t is sensitive to the set of imported functions
654a52b75SPeter Collingbourne; for each module, which in this case depends on the link order (the function
754a52b75SPeter Collingbourne; linkonce_odr will be imported from either t1 or t2, whichever comes first).
854a52b75SPeter Collingbourne
954a52b75SPeter Collingbourne; RUN: rm -rf %t.cache
107faa60c4SPeter Collingbourne; RUN: llvm-lto2 run -cache-dir %t.cache -o %t.o %t.bc %t1.bc %t2.bc -r=%t.bc,main,plx -r=%t.bc,f1,lx -r=%t.bc,f2,lx -r=%t1.bc,f1,plx -r=%t1.bc,linkonce_odr,plx -r=%t2.bc,f2,plx -r=%t2.bc,linkonce_odr,lx
117faa60c4SPeter Collingbourne; RUN: llvm-lto2 run -cache-dir %t.cache -o %t.o %t.bc %t2.bc %t1.bc -r=%t.bc,main,plx -r=%t.bc,f1,lx -r=%t.bc,f2,lx -r=%t2.bc,f2,plx -r=%t2.bc,linkonce_odr,plx -r=%t1.bc,f1,plx -r=%t1.bc,linkonce_odr,lx
1254a52b75SPeter Collingbourne; RUN: ls %t.cache | count 6
1354a52b75SPeter Collingbourne
14*7b1d7937SAmy Huangtarget datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
1554a52b75SPeter Collingbournetarget triple = "x86_64-unknown-linux-gnu"
1654a52b75SPeter Collingbourne
1754a52b75SPeter Collingbournedefine void @main() {
1854a52b75SPeter Collingbourne  call void @f1()
1954a52b75SPeter Collingbourne  call void @f2()
2054a52b75SPeter Collingbourne  ret void
2154a52b75SPeter Collingbourne}
2254a52b75SPeter Collingbourne
2354a52b75SPeter Collingbournedeclare void @f1()
2454a52b75SPeter Collingbournedeclare void @f2()
25