Index: tools/llvm-ld/llvm-ld.cpp
===================================================================
--- tools/llvm-ld/llvm-ld.cpp	(revision 84178)
+++ tools/llvm-ld/llvm-ld.cpp	(working copy)
@@ -570,7 +570,7 @@ int main(int argc, char **argv, char **envp) {
 
       // If there is no suffix add an "exe" one.
       sys::Path ExeFile( OutputFilename );
-      if (ExeFile.getSuffix() == "") {
+      if (ExeFile.getSuffix().empty()) {
         ExeFile.appendSuffix("exe");
         OutputFilename = ExeFile.str();
       }
Index: lib/System/Win32/Program.inc
===================================================================
--- lib/System/Win32/Program.inc	(revision 84178)
+++ lib/System/Win32/Program.inc	(working copy)
@@ -60,6 +60,13 @@ Program::FindProgramByName(const std::string& prog
     return Path();
   if (temp.canExecute()) // already executable as is
     return temp;
+  if (temp.getSuffix().empty()) {
+    // Try again with .exe suffix
+    temp.appendSuffix("exe");
+    if (temp.canExecute())
+      return temp;
+    temp.eraseSuffix();
+  }
 
   // At this point, the file name is valid and its not executable.
   // Let Windows search for it.
