Index: lld/trunk/COFF/Driver.cpp =================================================================== --- lld/trunk/COFF/Driver.cpp +++ lld/trunk/COFF/Driver.cpp @@ -574,6 +574,13 @@ // Parse command line options. opt::InputArgList Args = Parser.parseLINK(ArgsArr.slice(1)); + // Parse and evaluate -mllvm options. + std::vector V; + V.push_back("lld-link (LLVM option parsing)"); + for (auto *Arg : Args.filtered(OPT_mllvm)) + V.push_back(Arg->getValue()); + cl::ParseCommandLineOptions(V.size(), V.data()); + // Handle /help if (Args.hasArg(OPT_help)) { printHelp(ArgsArr[0]); Index: lld/trunk/test/COFF/lto-debug-pass-arguments.ll =================================================================== --- lld/trunk/test/COFF/lto-debug-pass-arguments.ll +++ lld/trunk/test/COFF/lto-debug-pass-arguments.ll @@ -0,0 +1,16 @@ +; REQUIRES: x86 +; RUN: llvm-as %s -o %t.obj +; RUN: lld-link /dll /out:%t.dll %t.obj /mllvm:-debug-pass=Arguments 2>&1 | FileCheck %s + +target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-pc-windows-msvc" + +define void @dummy() { + ret void +} + +define void @_DllMainCRTStartup() { + ret void +} + +; CHECK: Pass Arguments: