[VS Toolchain] Correctly forward -l linker inputs to link.exe.

Patch by Nikola Smiljanic!

llvm-svn: 158664
This commit is contained in:
Michael J. Spencer 2012-06-18 16:56:04 +00:00
parent e881ce2ef6
commit e2f493604a
2 changed files with 13 additions and 1 deletions

View File

@ -5739,7 +5739,14 @@ void visualstudio::Link::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-nologo");
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
Args.AddAllArgValues(CmdArgs, options::OPT_l);
// Add filenames immediately.
for (InputInfoList::const_iterator
it = Inputs.begin(), ie = Inputs.end(); it != ie; ++it) {
if (it->isFilename())
CmdArgs.push_back(it->getFilename());
}
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("link.exe"));

View File

@ -0,0 +1,5 @@
// RUN: %clang -target i686-pc-win32 -lkernel32.lib -luser32.lib -### %s 2>&1 | FileCheck %s
// CHECK-NOT: "-lkernel32.lib"
// CHECK-NOT: "-luser32.lib"
// CHECK: "kernel32.lib"
// CHECK: "user32.lib"