diff options
author | Greg Clayton <gclayton@apple.com> | 2016-12-08 02:11:03 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2016-12-08 02:11:03 +0000 |
commit | fd461fe360c3275effadb0ff5457f5820f07e891 (patch) | |
tree | 1125f370dc9996a1f8ef283ed7086f08f1e79a42 /llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp | |
parent | 49034417dad38fb0b6f6b486108d8e6d7495ff6d (diff) | |
download | bcm5719-llvm-fd461fe360c3275effadb0ff5457f5820f07e891.tar.gz bcm5719-llvm-fd461fe360c3275effadb0ff5457f5820f07e891.zip |
Unbreak buildbots where the debug info test was crashing due to unchecked error.
llvm-svn: 289017
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp')
-rw-r--r-- | llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp | 9 |
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> |