[llvm] 5b346fd - llvm-dwarfdump: Exit non-zero on an error path

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 22:10:53 PDT 2020


Author: David Blaikie
Date: 2020-10-14T22:10:43-07:00
New Revision: 5b346fd8c9949109802a34a8e702d31b6b3e1b70

URL: https://github.com/llvm/llvm-project/commit/5b346fd8c9949109802a34a8e702d31b6b3e1b70
DIFF: https://github.com/llvm/llvm-project/commit/5b346fd8c9949109802a34a8e702d31b6b3e1b70.diff

LOG: llvm-dwarfdump: Exit non-zero on an error path

Added: 
    

Modified: 
    llvm/test/tools/llvm-dwarfdump/cmdline.test
    llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-dwarfdump/cmdline.test b/llvm/test/tools/llvm-dwarfdump/cmdline.test
index 5c7b998338c7..11f6b15d4508 100644
--- a/llvm/test/tools/llvm-dwarfdump/cmdline.test
+++ b/llvm/test/tools/llvm-dwarfdump/cmdline.test
@@ -31,7 +31,7 @@ HELP: @FILE
 RUN: llvm-dwarfdump --version 2>&1 | FileCheck --check-prefix=VERSION %s
 VERSION: {{ version }}
 
-RUN: llvm-dwarfdump -
diff  -verbose 2>&1 | FileCheck --check-prefix=INCOMPATIBLE %s
+RUN: not llvm-dwarfdump -
diff  -verbose 2>&1 | FileCheck --check-prefix=INCOMPATIBLE %s
 INCOMPATIBLE: error: incompatible arguments: specifying both -
diff  and -verbose is currently not supported
 
 RUN: not llvm-dwarfdump --debug-names=0x0 2>&1 | FileCheck --check-prefix=FLAG %s

diff  --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index d8fa4f9953dc..abaf3140bcfb 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -624,7 +624,7 @@ int main(int argc, char **argv) {
   if (Diff && Verbose) {
     WithColor::error() << "incompatible arguments: specifying both -
diff  and "
                           "-verbose is currently not supported";
-    return 0;
+    return 1;
   }
 
   std::error_code EC;


        


More information about the llvm-commits mailing list