88 lines · plain
1; Test InProcessThinLTO thin link output from llvm-lto22; Partially copied from distributed_import.ll, and added checks for {dis|en}abling imports3 4; RUN: rm -f %t1.bc.thinlto.bc %t2.bc.thinlto.bc %t.out.1 %t.out.2 %t1.bc.imports %t2.bc.imports5 6; Generate bitcode files with summary, as well as minimized bitcode containing just the summary7; RUN: opt -thinlto-bc %s -thin-link-bitcode-file=%t1.thinlink.bc -o %t1.bc8; RUN: opt -thinlto-bc %p/Inputs/distributed_import.ll -thin-link-bitcode-file=%t2.thinlink.bc -o %t2.bc9 10; First perform the thin link on the normal bitcode file using11; -thinlto-distributed-indexes, collecting outputs to be compared with later.12; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \13; RUN: -thinlto-distributed-indexes \14; RUN: -thinlto-emit-imports \15; RUN: -r=%t1.bc,g, \16; RUN: -r=%t1.bc,analias, \17; RUN: -r=%t1.bc,f,px \18; RUN: -r=%t2.bc,g,px \19; RUN: -r=%t2.bc,analias,px \20; RUN: -r=%t2.bc,aliasee,px21; RUN: mv %t1.bc.thinlto.bc %t1.bc.thinlto.bc.orig22; RUN: mv %t2.bc.thinlto.bc %t2.bc.thinlto.bc.orig23; RUN: mv %t1.bc.imports %t1.bc.imports.orig24; RUN: mv %t2.bc.imports %t2.bc.imports.orig25 26; Now use -thinlto-emit-indexes instead.27; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \28; RUN: -thinlto-emit-indexes \29; RUN: -r=%t1.bc,g, \30; RUN: -r=%t1.bc,analias, \31; RUN: -r=%t1.bc,f,px \32; RUN: -r=%t2.bc,g,px \33; RUN: -r=%t2.bc,analias,px \34; RUN: -r=%t2.bc,aliasee,px \35; RUN: -o=%t.out36 37; Since InProcessThinLTO ran, there should be output38; RUN: ls %t.out.139; RUN: ls %t.out.240 41; Ensure imports weren't generated since -thinlto-emit-imports wasn't specified42; RUN: not ls %t1.bc.imports43; RUN: not ls %t2.bc.imports44 45; Compare the generated index files.46; RUN: diff %t1.bc.thinlto.bc %t1.bc.thinlto.bc.orig47; RUN: diff %t2.bc.thinlto.bc %t2.bc.thinlto.bc.orig48 49; RUN: rm -f %t1.bc.thinlto.bc %t2.bc.thinlto.bc %t.out.1 %t.out.250 51; Do the thin link again but also emit imports files now52; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \53; RUN: -thinlto-emit-indexes \54; RUN: -thinlto-emit-imports \55; RUN: -r=%t1.bc,g, \56; RUN: -r=%t1.bc,analias, \57; RUN: -r=%t1.bc,f,px \58; RUN: -r=%t2.bc,g,px \59; RUN: -r=%t2.bc,analias,px \60; RUN: -r=%t2.bc,aliasee,px \61; RUN: -o=%t.out62 63; Check the output64; RUN: ls %t.out.165; RUN: ls %t.out.266; RUN: diff %t1.bc.thinlto.bc %t1.bc.thinlto.bc.orig67; RUN: diff %t2.bc.thinlto.bc %t2.bc.thinlto.bc.orig68; RUN: diff %t1.bc.imports %t1.bc.imports.orig69; RUN: diff %t2.bc.imports %t2.bc.imports.orig70 71target triple = "x86_64-unknown-linux-gnu"72target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"73 74declare i32 @g(...)75declare void @analias(...)76 77define void @f() {78entry:79 call i32 (...) @g()80 call void (...) @analias()81 ret void82}83 84!llvm.dbg.cu = !{}85 86!1 = !{i32 2, !"Debug Info Version", i32 3}87!llvm.module.flags = !{!1}88