llvm.org GIT mirror llvm / db949a7
[LTO] Call InitLLVM from llvm-lto2 Summary: D45602 added this to most tools, including llvm-lto, but not to llvm-lto2. Add it there and test that it works in both lto tools. Reviewers: ruiu Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D53330 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344631 91177308-0d34-0410-b5e6-96231b3b80d8 Teresa Johnson 2 years ago
2 changed file(s) with 7 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
77 ; RUN: llvm-lto -exported-symbol=_main -thinlto-action=promote %t1.bc -thinlto-index=%t.index.bc -o - | llvm-lto -exported-symbol=_main -thinlto-action=internalize -thinlto-index %t.index.bc -thinlto-module-id=%t1.bc - -o - | llvm-dis -o - | FileCheck %s
88 ; RUN: llvm-lto -exported-symbol=_main -thinlto-action=promote %t2.bc -thinlto-index=%t.index.bc -o - | llvm-lto -exported-symbol=_main -thinlto-action=internalize -thinlto-index %t.index.bc -thinlto-module-id=%t2.bc - -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK2
99
10 ; RUN: llvm-lto -exported-symbol=_main -thinlto-action=run %t1.bc %t2.bc
10 ; RUN: llvm-lto -exported-symbol=_main -thinlto-action=run -stats %t1.bc %t2.bc 2>&1 | FileCheck %s --check-prefix=STATS
1111 ; RUN: llvm-nm %t1.bc.thinlto.o | FileCheck %s --check-prefix=CHECK-NM
1212
13 ; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.out -save-temps \
13 ; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.out -save-temps -stats \
1414 ; RUN: -r %t1.bc,_main,plx \
1515 ; RUN: -r %t1.bc,_bar,pl \
1616 ; RUN: -r %t1.bc,_dead_func,pl \
2424 ; RUN: -r %t2.bc,_dead_func,l \
2525 ; RUN: -r %t2.bc,_another_dead_func,pl \
2626 ; RUN: -thinlto-threads=1 \
27 ; RUN: -debug-only=function-import 2>&1 | FileCheck %s --check-prefix=DEBUG
27 ; RUN: -debug-only=function-import 2>&1 | FileCheck %s --check-prefix=DEBUG --check-prefix=STATS
2828 ; RUN: llvm-dis < %t.out.1.3.import.bc | FileCheck %s --check-prefix=LTO2
2929 ; RUN: llvm-dis < %t.out.2.3.import.bc | FileCheck %s --check-prefix=LTO2-CHECK2
3030 ; RUN: llvm-nm %t.out.1 | FileCheck %s --check-prefix=CHECK2-NM
8787 ; DEBUG-DAG: Ignores Dead GUID: 7546896869197086323 (baz)
8888 ; DEBUG-DAG: Initialize import for 15611644523426561710 (boo)
8989 ; DEBUG-DAG: Ignores Dead GUID: 2384416018110111308 (another_dead_func)
90
91 ; STATS: 3 function-import - Number of dead stripped symbols in index
9092
9193 ; Next test the case where Inputs/deadstrip.ll does not get a module index,
9294 ; which will cause it to be handled by regular LTO in the new LTO API.
2222 #include "llvm/LTO/LTO.h"
2323 #include "llvm/Support/CommandLine.h"
2424 #include "llvm/Support/FileSystem.h"
25 #include "llvm/Support/InitLLVM.h"
2526 #include "llvm/Support/TargetSelect.h"
2627 #include "llvm/Support/Threading.h"
2728
387388 }
388389
389390 int main(int argc, char **argv) {
391 InitLLVM X(argc, argv);
390392 InitializeAllTargets();
391393 InitializeAllTargetMCs();
392394 InitializeAllAsmPrinters();