[llvm-objcopy] Append '\n' to warning messages
authorFangrui Song <maskray@google.com>
Tue, 20 Aug 2019 15:00:07 +0000 (15:00 +0000)
committerFangrui Song <maskray@google.com>
Tue, 20 Aug 2019 15:00:07 +0000 (15:00 +0000)
Currently the warning message of `llvm-strip %t.o %t.o` does not include
the trailing newline. Fix this by appending a '\n'.

This is the only warning llvm-objcopy and llvm-strip can issue.

Reviewed By: jhenderson

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

llvm-svn: 369391

llvm/test/tools/llvm-objcopy/ELF/same-file-strip.test
llvm/tools/llvm-objcopy/llvm-objcopy.cpp

index 304ecaf..9381e8f 100644 (file)
@@ -9,10 +9,11 @@
 
 # ERR: error: cannot specify '-' as an input file more than once
 
-# RUN: llvm-strip %t %t 2>&1 | FileCheck -check-prefix=WARN %s -DFILE=%t
-# RUN: llvm-strip %t %t %t 2>&1 | FileCheck -check-prefix=WARN %s -DFILE=%t
+# RUN: cp %t %t2
+# RUN: llvm-strip %t %t %t %t2 %t2 2>&1 | FileCheck -check-prefix=WARN %s -DFILE=%t -DFILE2=%t2
 
-# WARN: warning: '[[FILE]]' was already specified
+# WARN:      warning: '[[FILE]]' was already specified
+# WARN-NEXT: warning: '[[FILE2]]' was already specified
 
 --- !ELF
 FileHeader:
index e937217..9c0145f 100644 (file)
@@ -84,7 +84,7 @@ LLVM_ATTRIBUTE_NORETURN void reportError(StringRef File, Error E) {
 
 ErrorSuccess reportWarning(Error E) {
   assert(E);
-  WithColor::warning(errs(), ToolName) << toString(std::move(E));
+  WithColor::warning(errs(), ToolName) << toString(std::move(E)) << '\n';
   return Error::success();
 }