[lld] r265311 - Fix test which failed Error migration on Windows bots.

Pete Cooper via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 09:56:10 PDT 2016


Author: pete
Date: Mon Apr  4 11:56:09 2016
New Revision: 265311

URL: http://llvm.org/viewvc/llvm-project?rev=265311&view=rev
Log:
Fix test which failed Error migration on Windows bots.

Note, this is https://llvm.org/bugs/show_bug.cgi?id=27187.

The problem here was that just converting an error to a bool doesn't
always set the checked bit.  We only set that bit if the Error didn't
actually contain an error.  Otherwise we'd end potentially up silently
dropping it.

Instead just use the consumeError method which is designed to allow us
to drop an error.

Modified:
    lld/trunk/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp

Modified: lld/trunk/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp?rev=265311&r1=265310&r2=265311&view=diff
==============================================================================
--- lld/trunk/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp (original)
+++ lld/trunk/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp Mon Apr  4 11:56:09 2016
@@ -738,7 +738,6 @@ TEST(BinaryReaderTest, hello_obj_ppc) {
   auto ec = writeBinary(*f, "/tmp/foo.o");
   // FIXME: We want to do EXPECT_FALSE(ec) but that fails on some Windows bots,
   // probably due to /tmp not being available.
-  // For now just check if an error happens as we need to mark it as checked.
-  bool failed = (bool)ec;
-  (void)failed;
+  // For now just consume the error without checking it.
+  consumeError(std::move(ec));
 }




More information about the llvm-commits mailing list