summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp')
-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