[llvm] 40903ba - llvm-reduce: Fix missing newline after error message

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 06:09:21 PST 2023


Author: Matt Arsenault
Date: 2023-01-03T09:09:17-05:00
New Revision: 40903bad468b71391257d56f33a67f3b5fa08f00

URL: https://github.com/llvm/llvm-project/commit/40903bad468b71391257d56f33a67f3b5fa08f00
DIFF: https://github.com/llvm/llvm-project/commit/40903bad468b71391257d56f33a67f3b5fa08f00.diff

LOG: llvm-reduce: Fix missing newline after error message

Fixes missing test coverage for the failed to execute case. However,
this test fails to verify the newline is printed. I can't figure out
how to get FileCheck to match the trailing newline.

Added: 
    llvm/test/tools/llvm-reduce/fail-execute-test.test

Modified: 
    llvm/tools/llvm-reduce/TestRunner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-reduce/fail-execute-test.test b/llvm/test/tools/llvm-reduce/fail-execute-test.test
new file mode 100644
index 0000000000000..badf376496525
--- /dev/null
+++ b/llvm/test/tools/llvm-reduce/fail-execute-test.test
@@ -0,0 +1,3 @@
+# RUN: not llvm-reduce --test=%s.NotAFileInTestingDir %p/Inputs/test-output-format.ll 2>&1 | FileCheck -DFILENAME=%s.NotAFileInTestingDir --strict-whitespace %s
+
+# CHECK: Error running interesting-ness test: Executable "[[FILENAME]]" doesn't exist!{{$}}
\ No newline at end of file

diff  --git a/llvm/tools/llvm-reduce/TestRunner.cpp b/llvm/tools/llvm-reduce/TestRunner.cpp
index fe905b38edfdd..058664d2e9a30 100644
--- a/llvm/tools/llvm-reduce/TestRunner.cpp
+++ b/llvm/tools/llvm-reduce/TestRunner.cpp
@@ -57,7 +57,7 @@ int TestRunner::run(StringRef Filename) const {
     Error E = make_error<StringError>("Error running interesting-ness test: " +
                                           ErrMsg,
                                       inconvertibleErrorCode());
-    errs() << toString(std::move(E));
+    errs() << toString(std::move(E)) << '\n';
     exit(1);
   }
 


        


More information about the llvm-commits mailing list