diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -119,6 +119,9 @@ lld::stdoutOS = &stdoutOS; lld::stderrOS = &stderrOS; + stderrOS.enable_colors(stderrOS.has_colors()); + // TODO: Set up error handler properly, e.g. the errorLimitExceededMsg + MachOOptTable parser; opt::InputArgList args = parser.parse(argsArr.slice(1)); diff --git a/lld/test/MachO/alignment-too-large.yaml b/lld/test/MachO/alignment-too-large.yaml --- a/lld/test/MachO/alignment-too-large.yaml +++ b/lld/test/MachO/alignment-too-large.yaml @@ -1,7 +1,7 @@ # RUN: yaml2obj %s -o %t.o # RUN: not lld -flavor darwinnew -o %t %t.o 2>&1 | FileCheck %s # -# CHECK: alignment 32 of section __text is too large +# CHECK: error: alignment 32 of section __text is too large --- !mach-o FileHeader: magic: 0xFEEDFACF diff --git a/lld/test/MachO/arch.s b/lld/test/MachO/arch.s --- a/lld/test/MachO/arch.s +++ b/lld/test/MachO/arch.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-darwin %s -o %t.o # RUN: lld -flavor darwinnew -arch x86_64 -o /dev/null %t.o # RUN: not lld -flavor darwinnew -arch i386 -o /dev/null %t.o 2>&1 | FileCheck %s -# CHECK: missing or unsupported -arch i386 +# CHECK: error: missing or unsupported -arch i386 .text .global _main diff --git a/lld/test/MachO/duplicate-symbol.s b/lld/test/MachO/duplicate-symbol.s --- a/lld/test/MachO/duplicate-symbol.s +++ b/lld/test/MachO/duplicate-symbol.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t-dup.o # RUN: not lld -flavor darwinnew -o /dev/null %t-dup.o %t.o 2>&1 | FileCheck %s -# CHECK: duplicate symbol: _main +# CHECK: error: duplicate symbol: _main .text .global _main diff --git a/lld/test/MachO/entry-symbol.s b/lld/test/MachO/entry-symbol.s --- a/lld/test/MachO/entry-symbol.s +++ b/lld/test/MachO/entry-symbol.s @@ -4,8 +4,8 @@ # RUN: not lld -flavor darwinnew -o /dev/null %t.o -e _missing 2>&1 | FileCheck %s # RUN: not lld -flavor darwinnew -o /dev/null %t.o 2>&1 | FileCheck %s --check-prefix=DEFAULT_ENTRY -# CHECK: undefined symbol: _missing -# DEFAULT_ENTRY: undefined symbol: _main +# CHECK: error: undefined symbol: _missing +# DEFAULT_ENTRY: error: undefined symbol: _main .text .global _not_main diff --git a/lld/test/MachO/invalid-executable.s b/lld/test/MachO/invalid-executable.s --- a/lld/test/MachO/invalid-executable.s +++ b/lld/test/MachO/invalid-executable.s @@ -1,8 +1,8 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-darwin %s -o %t.o # RUN: lld -flavor darwinnew -o %t %t.o -# RUN: not lld -flavor darwinnew -o /dev/null %t 2>&1 | FileCheck %s -# CHECK: unhandled file type +# RUN: not lld -flavor darwinnew -o /dev/null %t 2>&1 | FileCheck %s -DFILE=%t +# CHECK: error: [[FILE]]: unhandled file type .text .global _main diff --git a/lld/test/MachO/missing-dylib.s b/lld/test/MachO/missing-dylib.s --- a/lld/test/MachO/missing-dylib.s +++ b/lld/test/MachO/missing-dylib.s @@ -2,4 +2,4 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o # RUN: not lld -flavor darwinnew -Z -o %t -lmissing %t.o 2>&1 | FileCheck %s -# CHECK: library not found for -lmissing +# CHECK: error: library not found for -lmissing diff --git a/lld/test/MachO/no-id-dylink.s b/lld/test/MachO/no-id-dylink.s --- a/lld/test/MachO/no-id-dylink.s +++ b/lld/test/MachO/no-id-dylink.s @@ -3,7 +3,7 @@ # RUN: yaml2obj %p/Inputs/no-id-dylib.yaml -o %t/libnoid.dylib # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/no-id-dylink.o # RUN: not lld -flavor darwinnew -o %t/no-id-dylink -Z -L%t -lnoid %t/no-id-dylink.o 2>&1 | FileCheck %s -# CHECK: dylib {{.*}}libnoid.dylib missing LC_ID_DYLIB load command +# CHECK: error: dylib {{.*}}libnoid.dylib missing LC_ID_DYLIB load command .text .globl _main diff --git a/lld/test/MachO/no-such-file.s b/lld/test/MachO/no-such-file.s --- a/lld/test/MachO/no-such-file.s +++ b/lld/test/MachO/no-such-file.s @@ -1,4 +1,4 @@ # REQUIRES: x86 # RUN: not lld -flavor darwinnew -o /dev/null %t-no-such-file.o 2>&1 | FileCheck %s -# CHECK: cannot open {{.*}}no-such-file.o +# CHECK: error: cannot open {{.*}}no-such-file.o diff --git a/lld/test/MachO/silent-ignore.test b/lld/test/MachO/silent-ignore.test --- a/lld/test/MachO/silent-ignore.test +++ b/lld/test/MachO/silent-ignore.test @@ -5,4 +5,4 @@ RUN: -lto_library /lib/foo \ RUN: -macosx_version_min 0 RUN: not lld -flavor darwinnew -v --not-an-ignored-argument 2>&1 | FileCheck %s -CHECK: unknown argument: --not-an-ignored-argument +CHECK: error: unknown argument: --not-an-ignored-argument