-
Notifications
You must be signed in to change notification settings - Fork 14.3k
llvm-reduce: Change exit code for uninteresting inputs #134021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llvm-reduce: Change exit code for uninteresting inputs #134021
Conversation
This makes it easier to reduce llvm-reduce with llvm-reduce to filter cases where the input reduced too much. Not sure if it's possible to test the exit code in lit.
@llvm/pr-subscribers-llvm-binary-utilities Author: Matt Arsenault (arsenm) ChangesThis makes it easier to reduce llvm-reduce with llvm-reduce to filter Not sure if it's possible to test the exit code in lit. Full diff: https://github.com/llvm/llvm-project/pull/134021.diff 2 Files Affected:
diff --git a/llvm/docs/CommandGuide/llvm-reduce.rst b/llvm/docs/CommandGuide/llvm-reduce.rst
index 2670668af6cca..85111e6e29443 100644
--- a/llvm/docs/CommandGuide/llvm-reduce.rst
+++ b/llvm/docs/CommandGuide/llvm-reduce.rst
@@ -108,8 +108,9 @@ GENERIC OPTIONS
EXIT STATUS
------------
-:program:`llvm-reduce` returns 0 under normal operation. It returns a non-zero
-exit code if there were any errors.
+:program:`llvm-reduce` returns 0 under normal operation. It returns a
+non-zero exit code if there were any errors. Returns 2 if the
+interestingness test reported the initial input was not interesting.
EXAMPLE
-------
diff --git a/llvm/tools/llvm-reduce/llvm-reduce.cpp b/llvm/tools/llvm-reduce/llvm-reduce.cpp
index 288a384c2ed49..f7492988084ce 100644
--- a/llvm/tools/llvm-reduce/llvm-reduce.cpp
+++ b/llvm/tools/llvm-reduce/llvm-reduce.cpp
@@ -203,7 +203,7 @@ int main(int Argc, char **Argv) {
// interestingness checks.
if (!Tester.getProgram().isReduced(Tester)) {
errs() << "\nInput isn't interesting! Verify interesting-ness test\n";
- return 1;
+ return 2;
}
// Try to reduce code
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
non-zero exit code if there were any errors. Returns 2 if the | ||
interestingness test reported the initial input was not interesting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we document the return codes, should we also say something about the other return codes (basically 1 for all other errors?)
This makes it easier to reduce llvm-reduce with llvm-reduce to filter
cases where the input reduced too much.
Not sure if it's possible to test the exit code in lit.