Index: lld/trunk/Common/ErrorHandler.cpp =================================================================== --- lld/trunk/Common/ErrorHandler.cpp +++ lld/trunk/Common/ErrorHandler.cpp @@ -73,8 +73,7 @@ void ErrorHandler::log(const Twine &Msg) { if (Verbose) { std::lock_guard Lock(Mu); - outs() << LogName << ": " << Msg << "\n"; - outs().flush(); + *ErrorOS << LogName << ": " << Msg << "\n"; } } Index: lld/trunk/test/COFF/libpath.test =================================================================== --- lld/trunk/test/COFF/libpath.test +++ lld/trunk/test/COFF/libpath.test @@ -5,14 +5,14 @@ # RUN: env LIB=%t/a lld-link /out:%t.exe /entry:main /verbose \ # RUN: std64.lib /subsystem:console %p/Inputs/hello64.obj \ -# RUN: /libpath:%t/b /libpath:%t/c > %t.log +# RUN: /libpath:%t/b /libpath:%t/c 2> %t.log # RUN: FileCheck -check-prefix=CHECK1 %s < %t.log CHECK1: b{{[/\\]}}std64.lib # RUN: lld-link /out:%t.exe /entry:main /verbose \ # RUN: std64.lib /subsystem:console %p/Inputs/hello64.obj \ -# RUN: /libpath:%t/a /libpath:%t/b /libpath:%t/c > %t.log +# RUN: /libpath:%t/a /libpath:%t/b /libpath:%t/c 2> %t.log # RUN: FileCheck -check-prefix=CHECK2 %s < %t.log CHECK2: a{{[/\\]}}std64.lib Index: lld/trunk/test/COFF/msvclto-archive.ll =================================================================== --- lld/trunk/test/COFF/msvclto-archive.ll +++ lld/trunk/test/COFF/msvclto-archive.ll @@ -9,14 +9,14 @@ ; RUN: mkdir -p %t.dir ; RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t.dir/bitcode.obj %p/Inputs/msvclto.s ; RUN: lld-link %t-main1.a %t.dir/bitcode.obj /msvclto /out:%t.exe /opt:lldlto=1 /opt:icf \ -; RUN: /entry:main /verbose > %t.log || true +; RUN: /entry:main /verbose 2> %t.log || true ; RUN: FileCheck -check-prefix=BC %s < %t.log ; BC-NOT: Creating a temporary archive for ; RUN: rm -f %t-main2.a ; RUN: llvm-ar cru %t-main2.a %t.dir/bitcode.obj ; RUN: lld-link %t.obj %t-main2.a /msvclto /out:%t.exe /opt:lldlto=1 /opt:icf \ -; RUN: /entry:main /verbose > %t.log || true +; RUN: /entry:main /verbose 2> %t.log || true ; RUN: FileCheck -check-prefix=OBJ %s < %t.log ; OBJ-NOT: Creating a temporary archive @@ -25,7 +25,7 @@ ; RUN: rm -f %t-main3.a ; RUN: llvm-ar cruT %t-main3.a %t.dir/bitcode.obj ; RUN: lld-link %t.obj %t-main3.a /msvclto /out:%t.exe /opt:lldlto=1 /opt:icf \ -; RUN: /entry:main /verbose > %t.log || true +; RUN: /entry:main /verbose 2> %t.log || true ; RUN: FileCheck -check-prefix=THIN %s < %t.log ; THIN: Creating a temporary archive Index: lld/trunk/test/COFF/msvclto-order.ll =================================================================== --- lld/trunk/test/COFF/msvclto-order.ll +++ lld/trunk/test/COFF/msvclto-order.ll @@ -5,7 +5,7 @@ ; RUN: llc -filetype=obj %S/Inputs/msvclto-order-b.ll -o %T/msvclto-order-b.obj ; RUN: llvm-ar crs %T/msvclto-order-b.lib %T/msvclto-order-b.obj ; RUN: lld-link /verbose /msvclto /out:%t.exe /entry:main %t.obj \ -; RUN: %T/msvclto-order-a.lib %T/msvclto-order-b.lib > %t.log || true +; RUN: %T/msvclto-order-a.lib %T/msvclto-order-b.lib 2> %t.log || true ; RUN: FileCheck %s < %t.log ; CHECK: : link.exe Index: lld/trunk/test/COFF/msvclto.ll =================================================================== --- lld/trunk/test/COFF/msvclto.ll +++ lld/trunk/test/COFF/msvclto.ll @@ -3,7 +3,7 @@ ; RUN: mkdir -p %t.dir ; RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t.dir/bitcode.obj %p/Inputs/msvclto.s ; RUN: lld-link %t.obj %t.dir/bitcode.obj /msvclto /out:%t.exe /opt:lldlto=1 /opt:icf \ -; RUN: /entry:main /verbose > %t.log || true +; RUN: /entry:main /verbose 2> %t.log || true ; RUN: FileCheck %s < %t.log ; CHECK: /opt:icf /entry:main Index: lld/trunk/test/ELF/icf-absolute.s =================================================================== --- lld/trunk/test/ELF/icf-absolute.s +++ lld/trunk/test/ELF/icf-absolute.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/icf-absolute.s -o %t2 -# RUN: ld.lld %t %t2 -o %t3 --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t %t2 -o %t3 --icf=all --verbose 2>&1 | FileCheck %s # CHECK: selected .text.f1 # CHECK: removed .text.f2 Index: lld/trunk/test/ELF/icf-comdat.s =================================================================== --- lld/trunk/test/ELF/icf-comdat.s +++ lld/trunk/test/ELF/icf-comdat.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: ld.lld %t -o %t2 --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t -o %t2 --icf=all --verbose 2>&1 | FileCheck %s # CHECK: selected .text.f1 # CHECK: removed .text.f2 Index: lld/trunk/test/ELF/icf-i386.s =================================================================== --- lld/trunk/test/ELF/icf-i386.s +++ lld/trunk/test/ELF/icf-i386.s @@ -2,7 +2,7 @@ # This test is to make sure that we can handle implicit addends properly. # RUN: llvm-mc -filetype=obj -triple=i386-unknown-linux %s -o %t -# RUN: ld.lld %t -o %t2 --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t -o %t2 --icf=all --verbose 2>&1 | FileCheck %s # CHECK: selected .text.f1 # CHECK: removed .text.f2 Index: lld/trunk/test/ELF/icf-merge-sec.s =================================================================== --- lld/trunk/test/ELF/icf-merge-sec.s +++ lld/trunk/test/ELF/icf-merge-sec.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/icf-merge-sec.s -o %t2 -# RUN: ld.lld %t %t2 -o %t3 --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t %t2 -o %t3 --icf=all --verbose 2>&1 | FileCheck %s # CHECK: selected .text.f1 # CHECK: removed .text.f2 Index: lld/trunk/test/ELF/icf-merge.s =================================================================== --- lld/trunk/test/ELF/icf-merge.s +++ lld/trunk/test/ELF/icf-merge.s @@ -2,13 +2,13 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/icf-merge.s -o %t1 -# RUN: ld.lld %t %t1 -o %t1.out --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t %t1 -o %t1.out --icf=all --verbose 2>&1 | FileCheck %s # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/icf-merge2.s -o %t2 -# RUN: ld.lld %t %t2 -o %t3.out --icf=all --verbose | FileCheck --check-prefix=NOMERGE %s +# RUN: ld.lld %t %t2 -o %t3.out --icf=all --verbose 2>&1 | FileCheck --check-prefix=NOMERGE %s # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/icf-merge3.s -o %t3 -# RUN: ld.lld %t %t3 -o %t3.out --icf=all --verbose | FileCheck --check-prefix=NOMERGE %s +# RUN: ld.lld %t %t3 -o %t3.out --icf=all --verbose 2>&1 | FileCheck --check-prefix=NOMERGE %s # CHECK: selected .text.f1 # CHECK: removed .text.f2 Index: lld/trunk/test/ELF/icf-non-mergeable.s =================================================================== --- lld/trunk/test/ELF/icf-non-mergeable.s +++ lld/trunk/test/ELF/icf-non-mergeable.s @@ -8,7 +8,7 @@ // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \ // RUN: %p/Inputs/icf-non-mergeable.s -o %t2 -// RUN: ld.lld %t1 %t2 -o %t3 --icf=all --verbose | FileCheck %s +// RUN: ld.lld %t1 %t2 -o %t3 --icf=all --verbose 2>&1 | FileCheck %s // CHECK-NOT: selected .text.f1 // CHECK-NOT: removed .text.f2 Index: lld/trunk/test/ELF/icf-none.s =================================================================== --- lld/trunk/test/ELF/icf-none.s +++ lld/trunk/test/ELF/icf-none.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: ld.lld %t -o %t2 --icf=all --icf=none --verbose | FileCheck %s +# RUN: ld.lld %t -o %t2 --icf=all --icf=none --verbose 2>&1 | FileCheck %s # CHECK-NOT: selected .text.f1 Index: lld/trunk/test/ELF/icf1.s =================================================================== --- lld/trunk/test/ELF/icf1.s +++ lld/trunk/test/ELF/icf1.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: ld.lld %t -o %t2 --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t -o %t2 --icf=all --verbose 2>&1 | FileCheck %s # CHECK: selected .text.f1 # CHECK: removed .text.f2 Index: lld/trunk/test/ELF/icf2.s =================================================================== --- lld/trunk/test/ELF/icf2.s +++ lld/trunk/test/ELF/icf2.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/icf2.s -o %t2 -# RUN: ld.lld %t1 %t2 -o %t --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t1 %t2 -o %t --icf=all --verbose 2>&1 | FileCheck %s # CHECK: selected .text.f1 # CHECK: removed .text.f2 Index: lld/trunk/test/ELF/icf3.s =================================================================== --- lld/trunk/test/ELF/icf3.s +++ lld/trunk/test/ELF/icf3.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/icf2.s -o %t2 -# RUN: ld.lld %t1 %t2 -o %t --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t1 %t2 -o %t --icf=all --verbose 2>&1 | FileCheck %s # CHECK-NOT: Selected .text.f1 # CHECK-NOT: Selected .text.f2 Index: lld/trunk/test/ELF/icf4.s =================================================================== --- lld/trunk/test/ELF/icf4.s +++ lld/trunk/test/ELF/icf4.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: ld.lld %t -o %t2 --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t -o %t2 --icf=all --verbose 2>&1 | FileCheck %s # CHECK-NOT: Selected .text.f1 # CHECK-NOT: Selected .text.f2 Index: lld/trunk/test/ELF/icf5.s =================================================================== --- lld/trunk/test/ELF/icf5.s +++ lld/trunk/test/ELF/icf5.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: ld.lld %t -o %t2 --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t -o %t2 --icf=all --verbose 2>&1 | FileCheck %s # CHECK-NOT: Selected .text.f1 # CHECK-NOT: Selected .text.f2 Index: lld/trunk/test/ELF/icf6.s =================================================================== --- lld/trunk/test/ELF/icf6.s +++ lld/trunk/test/ELF/icf6.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: ld.lld %t -o %t2 --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t -o %t2 --icf=all --verbose 2>&1 | FileCheck %s # CHECK-NOT: Selected .text.f1 # CHECK-NOT: Selected .text.f2 Index: lld/trunk/test/ELF/icf7.s =================================================================== --- lld/trunk/test/ELF/icf7.s +++ lld/trunk/test/ELF/icf7.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: ld.lld %t -o %t2 --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t -o %t2 --icf=all --verbose 2>&1 | FileCheck %s # RUN: llvm-objdump -t %t2 | FileCheck -check-prefix=ALIGN %s # CHECK: selected .text.f1 Index: lld/trunk/test/ELF/icf9.s =================================================================== --- lld/trunk/test/ELF/icf9.s +++ lld/trunk/test/ELF/icf9.s @@ -2,7 +2,7 @@ ### Make sure that we do not merge data. # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: ld.lld %t -o %t2 --icf=all --verbose | FileCheck %s +# RUN: ld.lld %t -o %t2 --icf=all --verbose 2>&1 | FileCheck %s # RUN: llvm-readelf -S -W %t2 | FileCheck --check-prefix=SEC %s # SEC: .rodata PROGBITS 0000000000200120 000120 000002 00 A 0 0 1