mirror of
https://github.com/RPCSX/llvm.git
synced 2025-04-12 04:56:49 +00:00
[LTO] Add the ability to test -thinlto-emit-imports-files through llvm-lto2
Summary: Start bringing llvm-lto2 to a level where we can test the LTO API a bit deeper. Reviewers: tejohnson Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D23681 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279349 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8b3f7540b4
commit
cb9042aab4
@ -12,6 +12,19 @@
|
|||||||
; The imports file for Input/emit_imports.ll is empty as it does not import anything.
|
; The imports file for Input/emit_imports.ll is empty as it does not import anything.
|
||||||
; RUN: cat %t2.bc.imports | count 0
|
; RUN: cat %t2.bc.imports | count 0
|
||||||
|
|
||||||
|
; RUN: rm -f %t*.thinlto.bc %t*.bc.imports
|
||||||
|
; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o \
|
||||||
|
; RUN: -thinlto-distributed-indexes \
|
||||||
|
; RUN: -r=%t1.bc,g, \
|
||||||
|
; RUN: -r=%t1.bc,f,px \
|
||||||
|
; RUN: -r=%t2.bc,g,px
|
||||||
|
|
||||||
|
; RUN: cat %t1.bc.imports | count 1
|
||||||
|
; RUN: cat %t1.bc.imports | FileCheck %s --check-prefix=IMPORTS1
|
||||||
|
|
||||||
|
; The imports file for Input/emit_imports.ll is empty as it does not import anything.
|
||||||
|
; RUN: cat %t2.bc.imports | count 0
|
||||||
|
|
||||||
declare void @g(...)
|
declare void @g(...)
|
||||||
|
|
||||||
define void @f() {
|
define void @f() {
|
||||||
|
@ -33,6 +33,15 @@ static cl::opt<std::string> OutputFilename("o", cl::Required,
|
|||||||
|
|
||||||
static cl::opt<bool> SaveTemps("save-temps", cl::desc("Save temporary files"));
|
static cl::opt<bool> SaveTemps("save-temps", cl::desc("Save temporary files"));
|
||||||
|
|
||||||
|
static cl::opt<bool>
|
||||||
|
ThinLTODistributedIndexes("thinlto-distributed-indexes", cl::init(false),
|
||||||
|
cl::desc("Write out individual index and "
|
||||||
|
"import files for the "
|
||||||
|
"distributed backend case"));
|
||||||
|
|
||||||
|
static cl::opt<int> Threads("-thinlto-threads",
|
||||||
|
cl::init(thread::hardware_concurrency()));
|
||||||
|
|
||||||
static cl::list<std::string> SymbolResolutions(
|
static cl::list<std::string> SymbolResolutions(
|
||||||
"r",
|
"r",
|
||||||
cl::desc("Specify a symbol resolution: filename,symbolname,resolution\n"
|
cl::desc("Specify a symbol resolution: filename,symbolname,resolution\n"
|
||||||
@ -135,7 +144,12 @@ int main(int argc, char **argv) {
|
|||||||
check(Conf.addSaveTemps(OutputFilename + "."),
|
check(Conf.addSaveTemps(OutputFilename + "."),
|
||||||
"Config::addSaveTemps failed");
|
"Config::addSaveTemps failed");
|
||||||
|
|
||||||
LTO Lto(std::move(Conf));
|
ThinBackend Backend;
|
||||||
|
if (ThinLTODistributedIndexes)
|
||||||
|
Backend = createWriteIndexesThinBackend("", "", true, "");
|
||||||
|
else
|
||||||
|
Backend = createInProcessThinBackend(Threads);
|
||||||
|
LTO Lto(std::move(Conf), std::move(Backend));
|
||||||
|
|
||||||
bool HasErrors = false;
|
bool HasErrors = false;
|
||||||
for (std::string F : InputFilenames) {
|
for (std::string F : InputFilenames) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user