Index: MinGW/Driver.cpp =================================================================== --- MinGW/Driver.cpp +++ MinGW/Driver.cpp @@ -159,6 +159,9 @@ error("unknown parameter: -m" + S); } + for (auto *A : Args.filtered(OPT_mllvm)) + Add("-mllvm:" + StringRef(A->getValue())); + if (Args.getLastArgValue(OPT_m) == "i386pe") Add("-alternatename:__image_base__=___ImageBase"); else Index: MinGW/Options.td =================================================================== --- MinGW/Options.td +++ MinGW/Options.td @@ -13,6 +13,7 @@ HelpText<"Path to file to write output">; def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"">, HelpText<"Root name of library to use">; +def mllvm: S<"mllvm">; def shared: F<"shared">, HelpText<"Build a shared object">; def subs: Separate<["--"], "subsystem">, HelpText<"Specify subsystem">; def stack: Separate<["--"], "stack">; Index: test/MinGW/lto-debug-pass-arguments.ll =================================================================== --- /dev/null +++ test/MinGW/lto-debug-pass-arguments.ll @@ -0,0 +1,16 @@ +; REQUIRES: x86 +; RUN: llvm-as %s -o %t.obj +; RUN: ld.lld -m i386pep -shared -o %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-gnu" + +define void @dummy() { + ret void +} + +define void @_DllMainCRTStartup() { + ret void +} + +; CHECK: Pass Arguments: