[llvm] r289017 - Unbreak buildbots where the debug info test was crashing due to unchecked error.

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 18:11:03 PST 2016


Author: gclayton
Date: Wed Dec  7 20:11:03 2016
New Revision: 289017

URL: http://llvm.org/viewvc/llvm-project?rev=289017&view=rev
Log:
Unbreak buildbots where the debug info test was crashing due to unchecked error.


Modified:
    llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp

Modified: llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp?rev=289017&r1=289016&r2=289017&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp Wed Dec  7 20:11:03 2016
@@ -51,14 +51,15 @@ Triple getHostTripleForAddrSize(uint8_t
 /// \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>




More information about the llvm-commits mailing list