llvm-dwarfdump: Exit non-zero on an error path
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 15 Oct 2020 05:10:18 +0000 (22:10 -0700)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 15 Oct 2020 05:10:43 +0000 (22:10 -0700)
llvm/test/tools/llvm-dwarfdump/cmdline.test
llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

index 5c7b998..11f6b15 100644 (file)
@@ -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
index d8fa4f9..abaf314 100644 (file)
@@ -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;