[llvm] r299967 - llvm-lto2: Move the LTO::run() action behind a subcommand.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 11:12:01 PDT 2017


Author: pcc
Date: Tue Apr 11 13:12:00 2017
New Revision: 299967

URL: http://llvm.org/viewvc/llvm-project?rev=299967&view=rev
Log:
llvm-lto2: Move the LTO::run() action behind a subcommand.

Move LTO::run() to a "run" subcommand so that we can introduce new subcommands
for testing different parts of the LTO implementation.

This doesn't use llvm::cl subcommands because it doesn't appear to be currently
possible to pass an argument not associated with a subcommand to a subcommand
(e.g. -lto-use-new-pm, -mcpu=yonah).

Differential Revision: https://reviews.llvm.org/D31410

Modified:
    llvm/trunk/test/LTO/Resolution/X86/alias.ll
    llvm/trunk/test/LTO/Resolution/X86/asm-output.ll
    llvm/trunk/test/LTO/Resolution/X86/comdat.ll
    llvm/trunk/test/LTO/Resolution/X86/common2.ll
    llvm/trunk/test/LTO/Resolution/X86/commons.ll
    llvm/trunk/test/LTO/Resolution/X86/diagnostic-handler-remarks-with-hotness.ll
    llvm/trunk/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll
    llvm/trunk/test/LTO/Resolution/X86/empty-bitcode.test
    llvm/trunk/test/LTO/Resolution/X86/intrinsic.ll
    llvm/trunk/test/LTO/Resolution/X86/link-odr-availextern.ll
    llvm/trunk/test/LTO/Resolution/X86/lowertypetests.ll
    llvm/trunk/test/LTO/Resolution/X86/mixed_lto.ll
    llvm/trunk/test/LTO/Resolution/X86/multi-thinlto.ll
    llvm/trunk/test/LTO/X86/symver-asm.ll
    llvm/trunk/test/LTO/X86/symver-asm2.ll
    llvm/trunk/test/ThinLTO/X86/cache-config.ll
    llvm/trunk/test/ThinLTO/X86/cache-import-lists.ll
    llvm/trunk/test/ThinLTO/X86/cache-typeid-resolutions.ll
    llvm/trunk/test/ThinLTO/X86/cache.ll
    llvm/trunk/test/ThinLTO/X86/deadstrip.ll
    llvm/trunk/test/ThinLTO/X86/debuginfo-compositetype-import.ll
    llvm/trunk/test/ThinLTO/X86/dicompositetype-unique.ll
    llvm/trunk/test/ThinLTO/X86/distributed_import.ll
    llvm/trunk/test/ThinLTO/X86/emit_imports.ll
    llvm/trunk/test/ThinLTO/X86/empty_module_with_cache.ll
    llvm/trunk/test/ThinLTO/X86/error-newpm.ll
    llvm/trunk/test/ThinLTO/X86/funcimport2.ll
    llvm/trunk/test/ThinLTO/X86/internalize.ll
    llvm/trunk/test/ThinLTO/X86/linkonce_aliasee_ref_import.ll
    llvm/trunk/test/ThinLTO/X86/module_asm2.ll
    llvm/trunk/test/ThinLTO/X86/module_asm_glob.ll
    llvm/trunk/test/ThinLTO/X86/reference_non_importable.ll
    llvm/trunk/test/tools/llvm-lto2/X86/nodatalayout.ll
    llvm/trunk/test/tools/llvm-lto2/X86/pipeline.ll
    llvm/trunk/test/tools/llvm-lto2/errors.ll
    llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp

Modified: llvm/trunk/test/LTO/Resolution/X86/alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/alias.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/alias.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/alias.ll Tue Apr 11 13:12:00 2017
@@ -1,6 +1,6 @@
 ; RUN: llvm-as %s -o %t1.o
 ; RUN: llvm-as %p/Inputs/alias-1.ll -o %t2.o
-; RUN: llvm-lto2 -o %t3.o %t2.o %t1.o -r %t2.o,a,px -r %t1.o,a, -r %t1.o,b,px -save-temps
+; RUN: llvm-lto2 run -o %t3.o %t2.o %t1.o -r %t2.o,a,px -r %t1.o,a, -r %t1.o,b,px -save-temps
 ; RUN: llvm-dis < %t3.o.0.0.preopt.bc -o - | FileCheck %s
 ; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt
 

Modified: llvm/trunk/test/LTO/Resolution/X86/asm-output.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/asm-output.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/asm-output.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/asm-output.ll Tue Apr 11 13:12:00 2017
@@ -2,9 +2,9 @@
 ;
 ; RUN: llvm-as < %s > %t1.bc
 ;
-; RUN: llvm-lto2 -filetype=asm -r %t1.bc,main,px -o %t2 %t1.bc
+; RUN: llvm-lto2 run -filetype=asm -r %t1.bc,main,px -o %t2 %t1.bc
 ; RUN: FileCheck --check-prefix=ASM %s < %t2.0
-; RUN: llvm-lto2 -filetype=obj -r %t1.bc,main,px -o %t2 %t1.bc
+; RUN: llvm-lto2 run -filetype=obj -r %t1.bc,main,px -o %t2 %t1.bc
 ; RUN: llvm-objdump -d %t2.0 | FileCheck --check-prefix=ASM %s
 ;
 ; ASM: main:

Modified: llvm/trunk/test/LTO/Resolution/X86/comdat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/comdat.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/comdat.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/comdat.ll Tue Apr 11 13:12:00 2017
@@ -1,6 +1,6 @@
 ; RUN: llvm-as %s -o %t.o
 ; RUN: llvm-as %p/Inputs/comdat.ll -o %t2.o
-; RUN: llvm-lto2 -save-temps -o %t3.o %t.o %t2.o \
+; RUN: llvm-lto2 run -save-temps -o %t3.o %t.o %t2.o \
 ; RUN:  -r=%t.o,f1,plx \
 ; RUN:  -r=%t.o,v1,px \
 ; RUN:  -r=%t.o,r11,px \

Modified: llvm/trunk/test/LTO/Resolution/X86/common2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/common2.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/common2.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/common2.ll Tue Apr 11 13:12:00 2017
@@ -4,7 +4,7 @@
 ; Test that the common merging (size + alignment) is properly handled
 
 ; Client marked the "large with little alignment" one as prevailing
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:  -r %t1.bc,v,x \
 ; RUN:  -r %t2.bc,v,px \
 ; RUN:  -r %t1.bc,foo,px \
@@ -12,7 +12,7 @@
 ; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=LARGE-PREVAILED
 
 ; Same as before, but reversing the order of the inputs
-; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \
 ; RUN:  -r %t1.bc,v,x \
 ; RUN:  -r %t2.bc,v,px \
 ; RUN:  -r %t1.bc,foo,px \
@@ -20,7 +20,7 @@
 ; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=LARGE-PREVAILED
 
 ; Client marked the "small with large alignment" one as prevailing
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:  -r %t1.bc,v,px \
 ; RUN:  -r %t2.bc,v,x \
 ; RUN:  -r %t1.bc,foo,px \
@@ -28,7 +28,7 @@
 ; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=SMALL-PREVAILED
 
 ; Same as before, but reversing the order of the inputs
-; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \
 ; RUN:  -r %t1.bc,v,px \
 ; RUN:  -r %t2.bc,v,x \
 ; RUN:  -r %t1.bc,foo,px \
@@ -37,7 +37,7 @@
 
 
 ; Client didn't mark any as prevailing, we keep the first one we see as "external"
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:  -r %t1.bc,v,x \
 ; RUN:  -r %t2.bc,v,x \
 ; RUN:  -r %t1.bc,foo,px \
@@ -45,7 +45,7 @@
 ; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck  %s --check-prefix=NONE-PREVAILED1
 
 ; Same as before, but reversing the order of the inputs
-; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \
 ; RUN:  -r %t1.bc,v,x \
 ; RUN:  -r %t2.bc,v,x \
 ; RUN:  -r %t1.bc,foo,px \
@@ -55,7 +55,7 @@
 
 
 ; Client marked both as prevailing
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:  -r %t1.bc,v,px \
 ; RUN:  -r %t2.bc,v,px \
 ; RUN:  -r %t1.bc,foo,px \
@@ -63,7 +63,7 @@
 ; RUN: llvm-dis < %t.o.0.0.preopt.bc | FileCheck %s --check-prefix=BOTH-PREVAILED1
 
 ; Same as before, but reversing the order of the inputs
-; RUN: llvm-lto2 %t2.bc %t1.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t2.bc %t1.bc -o %t.o -save-temps \
 ; RUN:  -r %t1.bc,v,px \
 ; RUN:  -r %t2.bc,v,px \
 ; RUN:  -r %t1.bc,foo,px \

Modified: llvm/trunk/test/LTO/Resolution/X86/commons.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/commons.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/commons.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/commons.ll Tue Apr 11 13:12:00 2017
@@ -1,6 +1,6 @@
 ; RUN: llvm-as -o %t1.bc %s
 ; RUN: llvm-as -o %t2.bc %p/Inputs/commons.ll
-; RUN: llvm-lto2 %t1.bc -r=%t1.bc,x,l %t2.bc -r=%t2.bc,x,pl -o %t.out -save-temps
+; RUN: llvm-lto2 run %t1.bc -r=%t1.bc,x,l %t2.bc -r=%t2.bc,x,pl -o %t.out -save-temps
 ; RUN: llvm-dis -o - %t.out.0.0.preopt.bc  | FileCheck %s
 
 ; A strong definition should override the common

Modified: llvm/trunk/test/LTO/Resolution/X86/diagnostic-handler-remarks-with-hotness.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/diagnostic-handler-remarks-with-hotness.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/diagnostic-handler-remarks-with-hotness.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/diagnostic-handler-remarks-with-hotness.ll Tue Apr 11 13:12:00 2017
@@ -1,7 +1,7 @@
 ; RUN: llvm-as < %s >%t.bc
 
 ; RUN: rm -f %t.yaml
-; RUN: llvm-lto2 -pass-remarks-output=%t.yaml \
+; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \
 ; RUN:           -pass-remarks-with-hotness \
 ; RUN:           -r %t.bc,tinkywinky,p \
 ; RUN:           -r %t.bc,patatino,px \

Modified: llvm/trunk/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/diagnostic-handler-remarks.ll Tue Apr 11 13:12:00 2017
@@ -1,7 +1,7 @@
 ; RUN: llvm-as < %s >%t.bc
 
 ; RUN: rm -f %t.yaml
-; RUN: llvm-lto2 -pass-remarks-output=%t.yaml \
+; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \
 ; RUN:           -r %t.bc,tinkywinky,p \
 ; RUN:           -r %t.bc,patatino,px \
 ; RUN:           -r %t.bc,main,px -o %t.o %t.bc

Modified: llvm/trunk/test/LTO/Resolution/X86/empty-bitcode.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/empty-bitcode.test?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/empty-bitcode.test (original)
+++ llvm/trunk/test/LTO/Resolution/X86/empty-bitcode.test Tue Apr 11 13:12:00 2017
@@ -1,3 +1,3 @@
 RUN: llvm-cat -o %t.o
-RUN: not llvm-lto2 -o %t2 %t.o 2>&1 | FileCheck %s
+RUN: not llvm-lto2 run -o %t2 %t.o 2>&1 | FileCheck %s
 CHECK: Bitcode file does not contain any modules

Modified: llvm/trunk/test/LTO/Resolution/X86/intrinsic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/intrinsic.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/intrinsic.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/intrinsic.ll Tue Apr 11 13:12:00 2017
@@ -1,6 +1,6 @@
 ; RUN: llvm-as %s -o %t1.o
 ; RUN: llvm-as %p/Inputs/intrinsic.ll -o %t2.o
-; RUN: llvm-lto2 -o %t3.o %t1.o %t2.o -r %t1.o,foo
+; RUN: llvm-lto2 run -o %t3.o %t1.o %t2.o -r %t1.o,foo
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"

Modified: llvm/trunk/test/LTO/Resolution/X86/link-odr-availextern.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/link-odr-availextern.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/link-odr-availextern.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/link-odr-availextern.ll Tue Apr 11 13:12:00 2017
@@ -5,25 +5,25 @@
 ; RUN: llvm-as %S/Inputs/link-odr-availextern-ae.ll -o %t2ae
 ; RUN: llvm-as %S/Inputs/link-odr-availextern-odr.ll -o %t2odr
 
-; RUN: llvm-lto2 -o %t3 %t1 %t2ae -r %t1,f,p -r %t2ae,f, -save-temps
+; RUN: llvm-lto2 run -o %t3 %t1 %t2ae -r %t1,f,p -r %t2ae,f, -save-temps
 ; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=PREVAILING %s
 
-; RUN: llvm-lto2 -o %t3 %t1 %t2odr -r %t1,f,p -r %t2odr,f, -save-temps
+; RUN: llvm-lto2 run -o %t3 %t1 %t2odr -r %t1,f,p -r %t2odr,f, -save-temps
 ; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=PREVAILING %s
 
-; RUN: llvm-lto2 -o %t3 %t2ae %t1 -r %t1,f,p -r %t2ae,f, -save-temps
+; RUN: llvm-lto2 run -o %t3 %t2ae %t1 -r %t1,f,p -r %t2ae,f, -save-temps
 ; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=PREVAILING %s
 
-; RUN: llvm-lto2 -o %t3 %t2odr %t1 -r %t1,f,p -r %t2odr,f, -save-temps
+; RUN: llvm-lto2 run -o %t3 %t2odr %t1 -r %t1,f,p -r %t2odr,f, -save-temps
 ; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=PREVAILING %s
 
-; RUN: llvm-lto2 -o %t3 %t2ae -r %t2ae,f, -save-temps
+; RUN: llvm-lto2 run -o %t3 %t2ae -r %t2ae,f, -save-temps
 ; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=NONPREVAILING %s
 
-; RUN: llvm-lto2 -o %t3 %t2odr -r %t2odr,f, -save-temps
+; RUN: llvm-lto2 run -o %t3 %t2odr -r %t2odr,f, -save-temps
 ; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=NONPREVAILING %s
 
-; RUN: llvm-lto2 -o %t3 %t2odr %t1 -r %t1,f, -r %t2odr,f, -save-temps
+; RUN: llvm-lto2 run -o %t3 %t2odr %t1 -r %t1,f, -r %t2odr,f, -save-temps
 ; RUN: llvm-dis < %t3.0.0.preopt.bc -o - | FileCheck --check-prefix=NONPREVAILING %s
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

Modified: llvm/trunk/test/LTO/Resolution/X86/lowertypetests.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/lowertypetests.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/lowertypetests.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/lowertypetests.ll Tue Apr 11 13:12:00 2017
@@ -1,5 +1,5 @@
 ; RUN: opt -thinlto-bc -o %t %s
-; RUN: llvm-lto2 -r %t,f,plx -r %t,foo,lx -r %t,foo,plx -o %t1 %t
+; RUN: llvm-lto2 run -r %t,f,plx -r %t,foo,lx -r %t,foo,plx -o %t1 %t
 ; RUN: llvm-nm %t1.0 | FileCheck --check-prefix=MERGED %s
 ; RUN: llvm-nm %t1.1 | FileCheck %s
 

Modified: llvm/trunk/test/LTO/Resolution/X86/mixed_lto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/mixed_lto.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/mixed_lto.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/mixed_lto.ll Tue Apr 11 13:12:00 2017
@@ -2,7 +2,7 @@
 ; RUN: opt %s -o %t1.o
 ; RUN: opt -module-summary %p/Inputs/mixed_lto.ll -o %t2.o
 
-; RUN: llvm-lto2 -o %t3.o %t2.o %t1.o -r %t2.o,main,px -r %t2.o,g, -r %t1.o,g,px
+; RUN: llvm-lto2 run -o %t3.o %t2.o %t1.o -r %t2.o,main,px -r %t2.o,g, -r %t1.o,g,px
 
 ; Task 0 is the regular LTO file (this file)
 ; RUN: llvm-nm %t3.o.0 | FileCheck %s --check-prefix=NM0
@@ -15,7 +15,7 @@
 
 ; Do the same test again, but with the regular and thin LTO modules in the same file.
 ; RUN: llvm-cat -b -o %t4.o %t2.o %t1.o
-; RUN: llvm-lto2 -o %t5.o %t4.o -r %t4.o,main,px -r %t4.o,g, -r %t4.o,g,px
+; RUN: llvm-lto2 run -o %t5.o %t4.o -r %t4.o,main,px -r %t4.o,g, -r %t4.o,g,px
 ; RUN: llvm-nm %t5.o.0 | FileCheck %s --check-prefix=NM0
 ; RUN: llvm-nm %t5.o.1 | FileCheck %s --check-prefix=NM1
 

Modified: llvm/trunk/test/LTO/Resolution/X86/multi-thinlto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/multi-thinlto.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/multi-thinlto.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/multi-thinlto.ll Tue Apr 11 13:12:00 2017
@@ -1,6 +1,6 @@
 ; RUN: opt -module-summary %s -o %t.o
 ; RUN: llvm-cat -b -o %t2.o %t.o %t.o
-; RUN: not llvm-lto2 -o %t3.o %t2.o 2>&1 | FileCheck %s
+; RUN: not llvm-lto2 run -o %t3.o %t2.o 2>&1 | FileCheck %s
 ; CHECK: Expected at most one ThinLTO module per bitcode file
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

Modified: llvm/trunk/test/LTO/X86/symver-asm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/X86/symver-asm.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/X86/symver-asm.ll (original)
+++ llvm/trunk/test/LTO/X86/symver-asm.ll Tue Apr 11 13:12:00 2017
@@ -1,7 +1,7 @@
 ; RUN: llvm-as < %s >%t1
 ; RUN: llvm-lto -exported-symbol=io_cancel_0_4 -exported-symbol=io_cancel_weak_0_4 -exported-symbol=foo -o %t2 %t1
 ; RUN: llvm-nm %t2 | FileCheck %s
-; RUN: llvm-lto2 -r %t1,io_cancel_0_4,plx -r %t1,io_cancel_0_4,plx -r %t1,io_cancel_local_0_4,plx -r %t1,io_cancel_weak_0_4,plx -r %t1,io_cancel_weak_0_4,plx -r %t1,io_cancel@@LIBAIO_0.4,plx -r %t1,io_cancel_weak@@LIBAIO_0.4,plx -r %t1,io_cancel_weak@@LIBAIO_0.4.1,plx -r %t1,foo,plx -r %t1,foo,plx -r %t1,foo@@VER1,plx -o %t3 %t1 -save-temps
+; RUN: llvm-lto2 run -r %t1,io_cancel_0_4,plx -r %t1,io_cancel_0_4,plx -r %t1,io_cancel_local_0_4,plx -r %t1,io_cancel_weak_0_4,plx -r %t1,io_cancel_weak_0_4,plx -r %t1,io_cancel@@LIBAIO_0.4,plx -r %t1,io_cancel_weak@@LIBAIO_0.4,plx -r %t1,io_cancel_weak@@LIBAIO_0.4.1,plx -r %t1,foo,plx -r %t1,foo,plx -r %t1,foo@@VER1,plx -o %t3 %t1 -save-temps
 ; RUN: llvm-nm %t3.0 | FileCheck %s
 ; RUN: llvm-dis %t3.0.2.internalize.bc -o - | FileCheck %s --check-prefix=INTERN
 

Modified: llvm/trunk/test/LTO/X86/symver-asm2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/X86/symver-asm2.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/LTO/X86/symver-asm2.ll (original)
+++ llvm/trunk/test/LTO/X86/symver-asm2.ll Tue Apr 11 13:12:00 2017
@@ -6,7 +6,7 @@
 ; RUN: llvm-as < %s >%t1
 ; RUN: llvm-lto -o %t2 %t1
 ; RUN: llvm-nm %t2 | FileCheck %s
-; RUN: llvm-lto2 -r %t1,_start,plx -r %t1,_start3,plx -r %t1,foo@@SOME_VERSION -r %t1,foo at SOME_VERSION3 -o %t3 %t1 -save-temps
+; RUN: llvm-lto2 run -r %t1,_start,plx -r %t1,_start3,plx -r %t1,foo@@SOME_VERSION -r %t1,foo at SOME_VERSION3 -o %t3 %t1 -save-temps
 ; RUN: llvm-nm %t3.0 | FileCheck %s
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

Modified: llvm/trunk/test/ThinLTO/X86/cache-config.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/cache-config.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/cache-config.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/cache-config.ll Tue Apr 11 13:12:00 2017
@@ -1,21 +1,21 @@
 ; RUN: rm -rf %t.cache
 ; RUN: opt -module-hash -module-summary %s -o %t.bc
 
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -mcpu=yonah
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -relax-elf-relocations
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -function-sections
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -data-sections
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -debugger-tune=sce
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -mattr=+sse2
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -relocation-model=static
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -code-model=large
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -cg-opt-level=0
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -O1
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -opt-pipeline=loweratomic
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -aa-pipeline=basic-aa
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -override-triple=x86_64-unknown-linux-gnu
-; RUN: llvm-lto2 -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -default-triple=x86_64-unknown-linux-gnu
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -mcpu=yonah
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -relax-elf-relocations
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -function-sections
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -data-sections
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -debugger-tune=sce
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -mattr=+sse2
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -relocation-model=static
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -code-model=large
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -cg-opt-level=0
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -O1
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -opt-pipeline=loweratomic
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -aa-pipeline=basic-aa
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -override-triple=x86_64-unknown-linux-gnu
+; RUN: llvm-lto2 run -o %t.o %t.bc -cache-dir %t.cache -r=%t.bc,globalfunc,plx -default-triple=x86_64-unknown-linux-gnu
 ; RUN: ls %t.cache | count 15
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

Modified: llvm/trunk/test/ThinLTO/X86/cache-import-lists.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/cache-import-lists.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/cache-import-lists.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/cache-import-lists.ll Tue Apr 11 13:12:00 2017
@@ -7,8 +7,8 @@
 ; linkonce_odr will be imported from either t1 or t2, whichever comes first).
 
 ; RUN: rm -rf %t.cache
-; RUN: llvm-lto2 -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
-; RUN: llvm-lto2 -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
+; 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
+; 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
 ; RUN: ls %t.cache | count 6
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

Modified: llvm/trunk/test/ThinLTO/X86/cache-typeid-resolutions.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/cache-typeid-resolutions.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/cache-typeid-resolutions.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/cache-typeid-resolutions.ll Tue Apr 11 13:12:00 2017
@@ -9,17 +9,17 @@
 ; where both t and t-import are sensitive to typeid1's resolution
 ; so 4 distinct objects in total.
 ; RUN: rm -rf %t.cache
-; RUN: llvm-lto2 -o %t.o %t.bc %t-import.bc -cache-dir %t.cache -r=%t.bc,f1,plx -r=%t.bc,f2,plx -r=%t-import.bc,importf1,plx -r=%t-import.bc,f1,lx -r=%t-import.bc,importf2,plx -r=%t-import.bc,f2,lx
-; RUN: llvm-lto2 -o %t.o %t.bc %t-import.bc %t1.bc -cache-dir %t.cache -r=%t.bc,f1,plx -r=%t.bc,f2,plx -r=%t-import.bc,importf1,plx -r=%t-import.bc,f1,lx -r=%t-import.bc,importf2,plx -r=%t-import.bc,f2,lx -r=%t1.bc,vt1,plx
+; RUN: llvm-lto2 run -o %t.o %t.bc %t-import.bc -cache-dir %t.cache -r=%t.bc,f1,plx -r=%t.bc,f2,plx -r=%t-import.bc,importf1,plx -r=%t-import.bc,f1,lx -r=%t-import.bc,importf2,plx -r=%t-import.bc,f2,lx
+; RUN: llvm-lto2 run -o %t.o %t.bc %t-import.bc %t1.bc -cache-dir %t.cache -r=%t.bc,f1,plx -r=%t.bc,f2,plx -r=%t-import.bc,importf1,plx -r=%t-import.bc,f1,lx -r=%t-import.bc,importf2,plx -r=%t-import.bc,f2,lx -r=%t1.bc,vt1,plx
 ; RUN: ls %t.cache | count 4
 
 ; Three resolutions for typeid2: Indir, SingleImpl, UniqueRetVal
 ; where both t and t-import are sensitive to typeid2's resolution
 ; so 6 distinct objects in total.
 ; RUN: rm -rf %t.cache
-; RUN: llvm-lto2 -o %t.o %t.bc %t-import.bc -cache-dir %t.cache -r=%t.bc,f1,plx -r=%t.bc,f2,plx -r=%t-import.bc,importf1,plx -r=%t-import.bc,f1,lx -r=%t-import.bc,importf2,plx -r=%t-import.bc,f2,lx
-; RUN: llvm-lto2 -o %t.o %t.bc %t-import.bc %t2.bc -cache-dir %t.cache -r=%t.bc,f1,plx -r=%t.bc,f2,plx -r=%t2.bc,vt2,plx -r=%t-import.bc,importf1,plx -r=%t-import.bc,f1,lx -r=%t-import.bc,importf2,plx -r=%t-import.bc,f2,lx
-; RUN: llvm-lto2 -o %t.o %t.bc %t-import.bc %t3.bc -cache-dir %t.cache -r=%t.bc,f1,plx -r=%t.bc,f2,plx -r=%t3.bc,vt2a,plx -r=%t3.bc,vt2b,plx -r=%t-import.bc,importf1,plx -r=%t-import.bc,f1,lx -r=%t-import.bc,importf2,plx -r=%t-import.bc,f2,lx
+; RUN: llvm-lto2 run -o %t.o %t.bc %t-import.bc -cache-dir %t.cache -r=%t.bc,f1,plx -r=%t.bc,f2,plx -r=%t-import.bc,importf1,plx -r=%t-import.bc,f1,lx -r=%t-import.bc,importf2,plx -r=%t-import.bc,f2,lx
+; RUN: llvm-lto2 run -o %t.o %t.bc %t-import.bc %t2.bc -cache-dir %t.cache -r=%t.bc,f1,plx -r=%t.bc,f2,plx -r=%t2.bc,vt2,plx -r=%t-import.bc,importf1,plx -r=%t-import.bc,f1,lx -r=%t-import.bc,importf2,plx -r=%t-import.bc,f2,lx
+; RUN: llvm-lto2 run -o %t.o %t.bc %t-import.bc %t3.bc -cache-dir %t.cache -r=%t.bc,f1,plx -r=%t.bc,f2,plx -r=%t3.bc,vt2a,plx -r=%t3.bc,vt2b,plx -r=%t-import.bc,importf1,plx -r=%t-import.bc,f1,lx -r=%t-import.bc,importf2,plx -r=%t-import.bc,f2,lx
 ; RUN: ls %t.cache | count 6
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

Modified: llvm/trunk/test/ThinLTO/X86/cache.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/cache.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/cache.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/cache.ll Tue Apr 11 13:12:00 2017
@@ -11,7 +11,7 @@
 
 ; Verify that enabling caching is ignoring module without hash with llvm-lto2
 ; RUN: rm -Rf %t.cache
-; RUN: llvm-lto2 -o %t.o %t2.bc  %t.bc -cache-dir %t.cache \
+; RUN: llvm-lto2 run -o %t.o %t2.bc  %t.bc -cache-dir %t.cache \
 ; RUN:  -r=%t2.bc,_main,plx \
 ; RUN:  -r=%t2.bc,_globalfunc,lx \
 ; RUN:  -r=%t.bc,_globalfunc,plx
@@ -36,7 +36,7 @@
 
 ; Verify that enabling caching is working with llvm-lto2
 ; RUN: rm -Rf %t.cache
-; RUN: llvm-lto2 -o %t.o %t2.bc  %t.bc -cache-dir %t.cache \
+; RUN: llvm-lto2 run -o %t.o %t2.bc  %t.bc -cache-dir %t.cache \
 ; RUN:  -r=%t2.bc,_main,plx \
 ; RUN:  -r=%t2.bc,_globalfunc,lx \
 ; RUN:  -r=%t.bc,_globalfunc,plx

Modified: llvm/trunk/test/ThinLTO/X86/deadstrip.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/deadstrip.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/deadstrip.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/deadstrip.ll Tue Apr 11 13:12:00 2017
@@ -8,7 +8,7 @@
 ; RUN: llvm-lto -exported-symbol=_main -thinlto-action=run %t1.bc %t2.bc
 ; RUN: llvm-nm %t1.bc.thinlto.o | FileCheck %s --check-prefix=CHECK-NM
 
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.out -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.out -save-temps \
 ; RUN:   -r %t1.bc,_main,plx \
 ; RUN:   -r %t1.bc,_bar,pl \
 ; RUN:   -r %t1.bc,_dead_func,pl \
@@ -51,7 +51,7 @@
 ; In that case there are uses of @dead_func in the regular LTO partition
 ; and it shouldn't be internalized.
 ; RUN: opt %p/Inputs/deadstrip.ll -o %t3.bc
-; RUN: llvm-lto2 %t1.bc %t3.bc -o %t4.out -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t3.bc -o %t4.out -save-temps \
 ; RUN:   -r %t1.bc,_main,plx \
 ; RUN:   -r %t1.bc,_bar,pl \
 ; RUN:   -r %t1.bc,_dead_func,pl \

Modified: llvm/trunk/test/ThinLTO/X86/debuginfo-compositetype-import.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/debuginfo-compositetype-import.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/debuginfo-compositetype-import.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/debuginfo-compositetype-import.ll Tue Apr 11 13:12:00 2017
@@ -7,7 +7,7 @@
 
 ; By default, composite types are imported as type declarations
 ; RUN: llvm-lto -thinlto-action=import %t2.bc -thinlto-index=%t.index.bc -o - | llvm-dis -o - | FileCheck %s
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.out -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.out -save-temps \
 ; RUN:   -r %t2.bc,main,plx \
 ; RUN:   -r %t2.bc,foo,l \
 ; RUN:   -r %t1.bc,foo,pl
@@ -20,7 +20,7 @@
 
 ; Ensure that full type definitions of composite types are imported if requested
 ; RUN: llvm-lto -import-full-type-definitions -thinlto-action=import %t2.bc -thinlto-index=%t.index.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=FULL
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.out -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.out -save-temps \
 ; RUN:   -import-full-type-definitions \
 ; RUN:   -r %t2.bc,main,plx \
 ; RUN:   -r %t2.bc,foo,l \

Modified: llvm/trunk/test/ThinLTO/X86/dicompositetype-unique.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/dicompositetype-unique.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/dicompositetype-unique.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/dicompositetype-unique.ll Tue Apr 11 13:12:00 2017
@@ -1,7 +1,7 @@
 ; RUN: opt -module-summary -o %t1.bc %s
 ; RUN: opt -module-summary -o %t2.bc %S/Inputs/dicompositetype-unique.ll
 
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t --save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t --save-temps \
 ; RUN:    -r %t1.bc,_foo,lx \
 ; RUN:    -r %t1.bc,_main,plx \
 ; RUN:    -r %t2.bc,_foo,plx

Modified: llvm/trunk/test/ThinLTO/X86/distributed_import.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/distributed_import.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/distributed_import.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/distributed_import.ll Tue Apr 11 13:12:00 2017
@@ -6,7 +6,7 @@
 ; RUN: opt -thinlto-bc %p/Inputs/distributed_import.ll -thin-link-bitcode-file=%t2.thinlink.bc -o %t2.bc
 
 ; First perform the thin link on the normal bitcode file.
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:     -thinlto-distributed-indexes \
 ; RUN:     -r=%t1.bc,g, \
 ; RUN:     -r=%t1.bc,f,px \
@@ -30,7 +30,7 @@
 ; Next perform the thin link on the minimized bitcode files, and compare dumps
 ; of the resulting indexes to the above dumps to ensure they are identical.
 ; RUN: rm -f %t1.bc.thinlto.bc %t2.bc.thinlto.bc
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:     -thinlto-distributed-indexes \
 ; RUN:     -r=%t1.bc,g, \
 ; RUN:     -r=%t1.bc,f,px \

Modified: llvm/trunk/test/ThinLTO/X86/emit_imports.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/emit_imports.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/emit_imports.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/emit_imports.ll Tue Apr 11 13:12:00 2017
@@ -22,7 +22,7 @@
 ; RUN: rm -f %t1.thinlto.bc %t1.bc.imports
 ; RUN: rm -f %t2.thinlto.bc %t2.bc.imports
 ; RUN: rm -f %t3.bc.thinlto.bc %t3.bc.imports
-; RUN: llvm-lto2 %t1.bc %t2.bc %t3.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc %t3.bc -o %t.o -save-temps \
 ; RUN:     -thinlto-distributed-indexes \
 ; RUN:     -r=%t1.bc,g, \
 ; RUN:     -r=%t1.bc,f,px \

Modified: llvm/trunk/test/ThinLTO/X86/empty_module_with_cache.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/empty_module_with_cache.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/empty_module_with_cache.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/empty_module_with_cache.ll Tue Apr 11 13:12:00 2017
@@ -9,7 +9,7 @@
 
 ; Verify that enabling caching is working with llvm-lto2
 ; RUN: rm -Rf %t.cache
-; RUN: llvm-lto2 -o %t.o %t2.bc  %t.bc -cache-dir %t.cache \
+; RUN: llvm-lto2 run -o %t.o %t2.bc  %t.bc -cache-dir %t.cache \
 ; RUN:  -r=%t2.bc,_main,plx
 ; RUN: ls %t.cache | count 2
 
@@ -26,7 +26,7 @@
 
 ; Verify that caching is disabled for module without hash, with llvm-lto2
 ; RUN: rm -Rf %t.cache
-; RUN: llvm-lto2 -o %t.o %t2.bc  %t.bc -cache-dir %t.cache \
+; RUN: llvm-lto2 run -o %t.o %t2.bc  %t.bc -cache-dir %t.cache \
 ; RUN:  -r=%t2.bc,_main,plx
 ; RUN: ls %t.cache | count 0
 

Modified: llvm/trunk/test/ThinLTO/X86/error-newpm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/error-newpm.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/error-newpm.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/error-newpm.ll Tue Apr 11 13:12:00 2017
@@ -1,5 +1,5 @@
 ; RUN: opt -module-summary %s -o %t1.bc
-; RUN: not llvm-lto2 %t1.bc -o %t.o \
+; RUN: not llvm-lto2 run %t1.bc -o %t.o \
 ; RUN:     -r=%t1.bc,_tinkywinky,pxl \
 ; RUN:     -lto-use-new-pm 2>&1 | FileCheck %s
 

Modified: llvm/trunk/test/ThinLTO/X86/funcimport2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/funcimport2.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/funcimport2.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/funcimport2.ll Tue Apr 11 13:12:00 2017
@@ -2,7 +2,7 @@
 ; RUN: opt -module-summary %s -o %t1.bc
 ; RUN: opt -module-summary %p/Inputs/funcimport2.ll -o %t2.bc
 
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:     -r=%t1.bc,_foo,plx \
 ; RUN:     -r=%t2.bc,_main,plx \
 ; RUN:     -r=%t2.bc,_foo,l
@@ -11,7 +11,7 @@
 
 ; We shouldn't do any importing at -O0
 ; rm -f %t.o.1.3.import.bc
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:     -O0 \
 ; RUN:     -r=%t1.bc,_foo,plx \
 ; RUN:     -r=%t2.bc,_main,plx \

Modified: llvm/trunk/test/ThinLTO/X86/internalize.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/internalize.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/internalize.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/internalize.ll Tue Apr 11 13:12:00 2017
@@ -3,7 +3,7 @@
 ; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o - | llvm-dis -o - | FileCheck %s --check-prefix=REGULAR
 ; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o -  --exported-symbol=foo | llvm-dis -o - | FileCheck %s --check-prefix=INTERNALIZE
 
-; RUN: llvm-lto2 %t1.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc -o %t.o -save-temps \
 ; RUN:     -r=%t1.bc,_foo,pxl \
 ; RUN:     -r=%t1.bc,_bar,pl \
 ; RUN:     -r=%t1.bc,_linkonce_func,pl

Modified: llvm/trunk/test/ThinLTO/X86/linkonce_aliasee_ref_import.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/linkonce_aliasee_ref_import.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/linkonce_aliasee_ref_import.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/linkonce_aliasee_ref_import.ll Tue Apr 11 13:12:00 2017
@@ -7,7 +7,7 @@
 ; RUN: llvm-nm -o - < %t2.bc.thinlto.o | FileCheck %s --check-prefix=NM2
 
 ; Import with instr limit to ensure only foo imported.
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:    -r=%t1.bc,foo,pxl \
 ; RUN:    -r=%t1.bc,baz,pxl \
 ; RUN:    -r=%t1.bc,baz.clone,pxl \

Modified: llvm/trunk/test/ThinLTO/X86/module_asm2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/module_asm2.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/module_asm2.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/module_asm2.ll Tue Apr 11 13:12:00 2017
@@ -8,7 +8,7 @@
 ; RUN:  llvm-nm %t1.bc.thinlto.o | FileCheck  %s --check-prefix=NM0
 ; RUN:  llvm-nm %t2.bc.thinlto.o | FileCheck  %s --check-prefix=NM1
 
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:     -r=%t1.bc,foo,plx \
 ; RUN:     -r=%t1.bc,globalfunc,plx \
 ; RUN:     -r=%t1.bc,globalfunc,plx \

Modified: llvm/trunk/test/ThinLTO/X86/module_asm_glob.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/module_asm_glob.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/module_asm_glob.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/module_asm_glob.ll Tue Apr 11 13:12:00 2017
@@ -5,7 +5,7 @@
 ; RUN: llvm-nm %t1.bc.thinlto.o | FileCheck  %s --check-prefix=NM0
 ; RUN: llvm-nm %t2.bc.thinlto.o | FileCheck  %s --check-prefix=NM1
 
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:     -r=%t1.bc,foo,lx \
 ; RUN:     -r=%t1.bc,foo,plx \
 ; RUN:     -r=%t1.bc,_simplefunction,pl \

Modified: llvm/trunk/test/ThinLTO/X86/reference_non_importable.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/reference_non_importable.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/reference_non_importable.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/reference_non_importable.ll Tue Apr 11 13:12:00 2017
@@ -1,7 +1,7 @@
 ; RUN: opt -module-summary %s -o %t1.bc
 ; RUN: opt -module-summary %p/Inputs/reference_non_importable.ll -o %t2.bc
 
-; RUN: llvm-lto2 %t1.bc %t2.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
 ; RUN:     -r=%t1.bc,_foo,pxl \
 ; RUN:     -r=%t1.bc,_b,pxl \
 ; RUN:     -r=%t2.bc,_main,pxl \

Modified: llvm/trunk/test/tools/llvm-lto2/X86/nodatalayout.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-lto2/X86/nodatalayout.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-lto2/X86/nodatalayout.ll (original)
+++ llvm/trunk/test/tools/llvm-lto2/X86/nodatalayout.ll Tue Apr 11 13:12:00 2017
@@ -1,7 +1,7 @@
 ; RUN: llvm-as < %s > %t1.bc
 
 ; Reject input modules without a datalayout.
-; RUN: not llvm-lto2 %t1.bc -o %t.o \
+; RUN: not llvm-lto2 run %t1.bc -o %t.o \
 ; RUN:  -r %t1.bc,patatino,px 2>&1 | FileCheck %s
 
 ; CHECK: input module has no datalayout

Modified: llvm/trunk/test/tools/llvm-lto2/X86/pipeline.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-lto2/X86/pipeline.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-lto2/X86/pipeline.ll (original)
+++ llvm/trunk/test/tools/llvm-lto2/X86/pipeline.ll Tue Apr 11 13:12:00 2017
@@ -1,14 +1,14 @@
 ; RUN: llvm-as < %s > %t1.bc
 
 ; Try a custom pipeline
-; RUN: llvm-lto2 %t1.bc -o %t.o -save-temps \
+; RUN: llvm-lto2 run %t1.bc -o %t.o -save-temps \
 ; RUN:  -r %t1.bc,patatino,px -opt-pipeline loweratomic \
 ; RUN:  -aa-pipeline basic-aa
 ; RUN: llvm-dis < %t.o.0.4.opt.bc | FileCheck %s --check-prefix=CUSTOM
 
 ; Try the new pass manager LTO default pipeline (make sure the option
 ; is accepted).
-; RUN: llvm-lto2 %t1.bc -o %t.o -lto-use-new-pm -r %t1.bc,patatino,px
+; RUN: llvm-lto2 run %t1.bc -o %t.o -lto-use-new-pm -r %t1.bc,patatino,px
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
@@ -23,13 +23,13 @@ define void @patatino() {
 ; CUSTOM-NEXT: }
 
 ; Check that invalid pipelines are caught as errors.
-; RUN: not llvm-lto2 %t1.bc -o %t.o \
+; RUN: not llvm-lto2 run %t1.bc -o %t.o \
 ; RUN:  -r %t1.bc,patatino,px -opt-pipeline foogoo 2>&1 | \
 ; RUN:  FileCheck %s --check-prefix=ERR
 
 ; ERR: LLVM ERROR: unable to parse pass pipeline description: foogoo
 
-; RUN: not llvm-lto2 %t1.bc -o %t.o \
+; RUN: not llvm-lto2 run %t1.bc -o %t.o \
 ; RUN:  -r %t1.bc,patatino,px -aa-pipeline patatino \
 ; RUN:  -opt-pipeline loweratomic 2>&1 | \
 ; RUN:  FileCheck %s --check-prefix=AAERR

Modified: llvm/trunk/test/tools/llvm-lto2/errors.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-lto2/errors.ll?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-lto2/errors.ll (original)
+++ llvm/trunk/test/tools/llvm-lto2/errors.ll Tue Apr 11 13:12:00 2017
@@ -1,8 +1,8 @@
 ; RUN: llvm-as %s -o %t.bc
-; RUN: not llvm-lto2 -o %t2.o %t.bc 2>&1 | FileCheck --check-prefix=ERR1 %s
-; RUN: not llvm-lto2 -o %t2.o -r %t.bc,foo,p -r %t.bc,bar,p %t.bc 2>&1 | FileCheck --check-prefix=ERR2 %s
-; RUN: not llvm-lto2 -o %t2.o -r %t.bc,foo,q %t.bc 2>&1 | FileCheck --check-prefix=ERR3 %s
-; RUN: not llvm-lto2 -o %t2.o -r foo %t.bc 2>&1 | FileCheck --check-prefix=ERR4 %s
+; RUN: not llvm-lto2 run -o %t2.o %t.bc 2>&1 | FileCheck --check-prefix=ERR1 %s
+; RUN: not llvm-lto2 run -o %t2.o -r %t.bc,foo,p -r %t.bc,bar,p %t.bc 2>&1 | FileCheck --check-prefix=ERR2 %s
+; RUN: not llvm-lto2 run -o %t2.o -r %t.bc,foo,q %t.bc 2>&1 | FileCheck --check-prefix=ERR3 %s
+; RUN: not llvm-lto2 run -o %t2.o -r foo %t.bc 2>&1 | FileCheck --check-prefix=ERR4 %s
 
 ; ERR1: missing symbol resolution for {{.*}}.bc,foo
 ; ERR2: unused symbol resolution for {{.*}}.bc,bar

Modified: llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp?rev=299967&r1=299966&r2=299967&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp (original)
+++ llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp Tue Apr 11 13:12:00 2017
@@ -126,12 +126,12 @@ template <typename T> static T check(Err
   return T();
 }
 
-int main(int argc, char **argv) {
-  InitializeAllTargets();
-  InitializeAllTargetMCs();
-  InitializeAllAsmPrinters();
-  InitializeAllAsmParsers();
+static int usage() {
+  errs() << "Available subcommands: run\n";
+  return 1;
+}
 
+static int run(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, "Resolution-based LTO test harness");
 
   // FIXME: Workaround PR30396 which means that a symbol can appear
@@ -284,4 +284,25 @@ int main(int argc, char **argv) {
     Cache = check(localCache(CacheDir, AddBuffer), "failed to create cache");
 
   check(Lto.run(AddStream, Cache), "LTO::run failed");
+  return 0;
+}
+
+int main(int argc, char **argv) {
+  InitializeAllTargets();
+  InitializeAllTargetMCs();
+  InitializeAllAsmPrinters();
+  InitializeAllAsmParsers();
+
+  // FIXME: This should use llvm::cl subcommands, but it isn't currently
+  // possible to pass an argument not associated with a subcommand to a
+  // subcommand (e.g. -lto-use-new-pm).
+  if (argc < 2)
+    return usage();
+
+  StringRef Subcommand = argv[1];
+  // Ensure that argv[0] is correct after adjusting argv/argc.
+  argv[1] = argv[0];
+  if (Subcommand == "run")
+    return run(argc - 1, argv + 1);
+  return usage();
 }




More information about the llvm-commits mailing list