<div dir="ltr">That should be the correct fix. Please do this for ELF/Error.cpp too.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 28, 2017 at 2:01 PM, Hans Wennborg <span dir="ltr"><<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Oh, the test is actually invoking ms's link.exe which gets in the way.<br>
<br>
This fixes it. Rui: does this make sense, or is log() performance<br>
sensitive so we don't want to flush each time?<br>
<br>
iff --git a/COFF/Error.cpp b/COFF/Error.cpp<br>
index b2c7c89..166b197 100644<br>
--- a/COFF/Error.cpp<br>
+++ b/COFF/Error.cpp<br>
@@ -59,6 +59,7 @@ void log(const Twine &Msg) {<br>
   if (Config->Verbose) {<br>
     std::lock_guard<std::mutex> Lock(Mu);<br>
     outs() << Argv0 << ": " << Msg << "\n";<br>
+    outs().flush();<br>
<div class="HOEnZb"><div class="h5">   }<br>
 }<br>
<br>
On Fri, Apr 28, 2017 at 1:38 PM, Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>> wrote:<br>
> I don't normally run the lld tests on Windows, but I figured I should<br>
> make a start.<br>
><br>
> This test fails for me because it doesn't find "/verbose" in the<br>
> output, which looks like this:<br>
><br>
> C:/src/llvm/build.release/./<wbr>bin\lld-link.EXE: Reading<br>
> c:\src\llvm\build.release\<wbr>tools\lld\test\coff\output\<wbr>msvclto.ll.tmp.obj<br>
> C:/src/llvm/build.release/./<wbr>bin\lld-link.EXE: Reading<br>
> c:\src\llvm\build.release\<wbr>tools\lld\test\coff\output\<wbr>msvclto.ll.tmp.dir/bitcode.obj<br>
> C:/src/llvm/build.release/./<wbr>bin\lld-link.EXE: link.exe /nologo<br>
> C:\src\llvm\build.release\<wbr>tools\lld\test\COFF\Output\<wbr>msvclto.ll.tmp.dir/bitcode.obj<br>
> /out:C:\src\llvm\build.<wbr>release\tools\lld\test\COFF\<wbr>Output\msvclto.ll.tmp.exe<br>
> /opt:icf /entry:main<br>
> /ve<br>
> Starting pass 1<br>
><br>
> Searching libraries<br>
><br>
> Finished searching libraries<br>
><br>
> Finished pass 1<br>
><br>
> Starting pass 2<br>
>      lld-lto-540789.obj<br>
>      bitcode.obj<br>
> Finished pass 2<br>
> rbose<br>
> c:\src\temp\lit_tmp_6bloe9\<wbr>lld-lto-540789.obj<br>
><br>
><br>
> Amusingly, it looks like /verbose itself is racing with the code that<br>
> prints "/verbose"? :-)<br>
><br>
> On Tue, Apr 18, 2017 at 3:29 PM, Bob Haarman via llvm-commits<br>
> <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> Author: inglorion<br>
>> Date: Tue Apr 18 17:29:36 2017<br>
>> New Revision: 300616<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=300616&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=300616&view=rev</a><br>
>> Log:<br>
>> [coff] fix test for msvclto<br>
>><br>
>> Modified:<br>
>>     lld/trunk/test/COFF/msvclto.ll<br>
>><br>
>> Modified: lld/trunk/test/COFF/msvclto.ll<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/msvclto.ll?rev=300616&r1=300615&r2=300616&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/test/COFF/<wbr>msvclto.ll?rev=300616&r1=<wbr>300615&r2=300616&view=diff</a><br>
>> ==============================<wbr>==============================<wbr>==================<br>
>> --- lld/trunk/test/COFF/msvclto.ll (original)<br>
>> +++ lld/trunk/test/COFF/msvclto.ll Tue Apr 18 17:29:36 2017<br>
>> @@ -5,7 +5,8 @@<br>
>>  ; RUN:   /entry:main /verbose > %t.log || true<br>
>>  ; RUN: FileCheck %s < %t.log<br>
>><br>
>> -; CHECK: /opt:icf /entry:main /verbose<br>
>> +; CHECK: /opt:icf /entry:main<br>
>> +; CHECK: /verbose<br>
>><br>
>>  target datalayout = "e-m:w-i64:64-f80:128-n8:16:<wbr>32:64-S128"<br>
>>  target triple = "x86_64-pc-windows-msvc"<br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@lists.llvm.org">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/<wbr>mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>