summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2016-12-08 02:11:03 +0000
committerGreg Clayton <gclayton@apple.com>2016-12-08 02:11:03 +0000
commitfd461fe360c3275effadb0ff5457f5820f07e891 (patch)
tree1125f370dc9996a1f8ef283ed7086f08f1e79a42
parent49034417dad38fb0b6f6b486108d8e6d7495ff6d (diff)
downloadbcm5719-llvm-fd461fe360c3275effadb0ff5457f5820f07e891.tar.gz
bcm5719-llvm-fd461fe360c3275effadb0ff5457f5820f07e891.zip
Unbreak buildbots where the debug info test was crashing due to unchecked error.
llvm-svn: 289017
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
index ea796b43e3c..47709ff89ef 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
@@ -51,14 +51,15 @@ Triple getHostTripleForAddrSize(uint8_t AddrSize) {
/// \returns true if there were errors, false otherwise.
template <typename T>
static bool HandleExpectedError(T &Expected) {
- if (!Expected)
- return false;
std::string ErrorMsg;
handleAllErrors(Expected.takeError(), [&](const llvm::ErrorInfoBase &EI) {
ErrorMsg = EI.message();
});
- ::testing::AssertionFailure() << "error: " << ErrorMsg;
- return true;
+ if (!ErrorMsg.empty()) {
+ ::testing::AssertionFailure() << "error: " << ErrorMsg;
+ return true;
+ }
+ return false;
}
template <uint16_t Version, class AddrType, class RefAddrType>
OpenPOWER on IntegriCloud