summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/ReplaceFileTest.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-08-14 13:59:04 +0000
committerPavel Labath <pavel@labath.sk>2019-08-14 13:59:04 +0000
commit0d802a4923e6a603aa1ee06d0969a793cc93f858 (patch)
treefde71a9121ecb420aef7eb9c858b3101056a836e /llvm/unittests/Support/ReplaceFileTest.cpp
parent571c52af58d91662f2a7f2c7570bab63dee71a53 (diff)
downloadbcm5719-llvm-0d802a4923e6a603aa1ee06d0969a793cc93f858.tar.gz
bcm5719-llvm-0d802a4923e6a603aa1ee06d0969a793cc93f858.zip
Revert "raw_ostream: add operator<< overload for std::error_code"
This reverts commit r368849, because it breaks some bots (e.g. llvm-clang-x86_64-win-fast). It turns out this is not as NFC as we had hoped, because operator== will consider two std::error_codes to be distinct even though they both hold "success" values if they have different categories. llvm-svn: 368854
Diffstat (limited to 'llvm/unittests/Support/ReplaceFileTest.cpp')
-rw-r--r--llvm/unittests/Support/ReplaceFileTest.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/unittests/Support/ReplaceFileTest.cpp b/llvm/unittests/Support/ReplaceFileTest.cpp
index 9a870a78360..d2273d77f5e 100644
--- a/llvm/unittests/Support/ReplaceFileTest.cpp
+++ b/llvm/unittests/Support/ReplaceFileTest.cpp
@@ -17,7 +17,14 @@
using namespace llvm;
using namespace llvm::sys;
-#define ASSERT_NO_ERROR(x) ASSERT_EQ(x, std::error_code())
+#define ASSERT_NO_ERROR(x) \
+ do { \
+ if (std::error_code ASSERT_NO_ERROR_ec = x) { \
+ errs() << #x ": did not return errc::success.\n" \
+ << "error number: " << ASSERT_NO_ERROR_ec.value() << "\n" \
+ << "error message: " << ASSERT_NO_ERROR_ec.message() << "\n"; \
+ } \
+ } while (false)
namespace {
std::error_code CreateFileWithContent(const SmallString<128> &FilePath,
OpenPOWER on IntegriCloud