summaryrefslogtreecommitdiff
path: root/lld/unittests
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2016-04-04 16:56:09 +0000
committerPete Cooper <peter_cooper@apple.com>2016-04-04 16:56:09 +0000
commit5eb4b139398593cece70b92de4be0831396651e9 (patch)
tree404bbb849b4d992d9c8424a8b92296fa1a4b6755 /lld/unittests
parent292b608b5caa8b9e4b203c70c79317225ea83c23 (diff)
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.
Diffstat (limited to 'lld/unittests')
-rw-r--r--lld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp b/lld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
index 923f61b546d..277627e1e6c 100644
--- a/lld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
+++ b/lld/unittests/MachOTests/MachONormalizedFileBinaryReaderTests.cpp
@@ -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));
}