<div dir="ltr">Given that you were fixing a crash - that speaks to the existence of a test failure? But perhaps only in a linker-plugin situation & that's what's proving difficult to port into the LLVM test environment?<br><br>I'd suggest checking to see if llvm-lto2 can reproduce the same codepath & failure, perhaps?<br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 19, 2018 at 9:43 AM Adam Nemet <<a href="mailto:anemet@apple.com">anemet@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I of course thought about that but I don’t know how.  I was trying to get inspiration from the large patch that added the buggy code in r254721 but that didn’t add a single testcase either :(.  I am open to hear ideas...</div><div style="word-wrap:break-word"><div><br><div><blockquote type="cite"><div>On Mar 19, 2018, at 9:23 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br class="m_1454284176943590830Apple-interchange-newline"><div><div dir="ltr">Test case?</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 12, 2018 at 9:39 PM Adam Nemet via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: anemet<br>
Date: Mon Mar 12 21:37:01 2018<br>
New Revision: 327359<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=327359&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=327359&view=rev</a><br>
Log:<br>
[LTO] Return proper error object rather than null LTOModule<br>
<br>
This caused a crash in LTOModule::createInLocalContext.<br>
<br>
<a>rdar://37926841</a><br>
<br>
Modified:<br>
    llvm/trunk/lib/LTO/LTOModule.cpp<br>
<br>
Modified: llvm/trunk/lib/LTO/LTOModule.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=327359&r1=327358&r2=327359&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=327359&r1=327358&r2=327359&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/LTO/LTOModule.cpp (original)<br>
+++ llvm/trunk/lib/LTO/LTOModule.cpp Mon Mar 12 21:37:01 2018<br>
@@ -208,7 +208,7 @@ LTOModule::makeLTOModule(MemoryBufferRef<br>
   std::string errMsg;<br>
   const Target *march = TargetRegistry::lookupTarget(TripleStr, errMsg);<br>
   if (!march)<br>
-    return std::unique_ptr<LTOModule>(nullptr);<br>
+    return make_error_code(object::object_error::arch_not_found);<br>
<br>
   // construct LTOModule, hand over ownership of module and target<br>
   SubtargetFeatures Features;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div>