[lld] r278797 - [ELF] - Do not exit if -v is specified.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 06:25:54 PDT 2016


Author: grimar
Date: Tue Aug 16 08:25:53 2016
New Revision: 278797

URL: http://llvm.org/viewvc/llvm-project?rev=278797&view=rev
Log:
[ELF] - Do not exit if -v is specified.

Previously lld showed version number and returned,
that is different from ld and PR28999.

Patch fixed that.

Modified:
    lld/trunk/ELF/Driver.cpp
    lld/trunk/test/ELF/driver.test

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=278797&r1=278796&r2=278797&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Tue Aug 16 08:25:53 2016
@@ -263,10 +263,8 @@ void LinkerDriver::main(ArrayRef<const c
     printHelp(ArgsArr[0]);
     return;
   }
-  if (Args.hasArg(OPT_version)) {
+  if (Args.hasArg(OPT_version))
     outs() << getVersionString();
-    return;
-  }
 
   if (const char *Path = getReproduceOption(Args)) {
     // Note that --reproduce is a debug option so you can ignore it

Modified: lld/trunk/test/ELF/driver.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/driver.test?rev=278797&r1=278796&r2=278797&view=diff
==============================================================================
--- lld/trunk/test/ELF/driver.test (original)
+++ lld/trunk/test/ELF/driver.test Tue Aug 16 08:25:53 2016
@@ -16,7 +16,7 @@
 # RUN: ld.lld --help 2>&1 | FileCheck -check-prefix=HELP %s
 # HELP: USAGE:
 
-# RUN: ld.lld --version 2>&1 | FileCheck -check-prefix=VERSION %s
+# RUN: not ld.lld --version 2>&1 | FileCheck -check-prefix=VERSION %s
 # VERSION: LLD
 
 ## Attempt to link DSO with -r




More information about the llvm-commits mailing list