diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp --- a/lld/MinGW/Driver.cpp +++ b/lld/MinGW/Driver.cpp @@ -427,7 +427,10 @@ return false; if (args.hasArg(OPT_verbose) || args.hasArg(OPT__HASH_HASH_HASH)) - lld::outs() << llvm::join(linkArgs, " ") << "\n"; + // Print to stdout if testing with -###, otherwise to stderr like other + // regular logging. + (args.hasArg(OPT__HASH_HASH_HASH) ? lld::outs() : lld::errs()) + << llvm::join(linkArgs, " ") << "\n"; if (args.hasArg(OPT__HASH_HASH_HASH)) return true;