From 5b346fd8c9949109802a34a8e702d31b6b3e1b70 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 14 Oct 2020 22:10:18 -0700 Subject: [PATCH] llvm-dwarfdump: Exit non-zero on an error path --- llvm/test/tools/llvm-dwarfdump/cmdline.test | 2 +- llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/test/tools/llvm-dwarfdump/cmdline.test b/llvm/test/tools/llvm-dwarfdump/cmdline.test index 5c7b998..11f6b15 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 d8fa4f9..abaf314 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; -- 2.7.4