Fix test breakage on Windows.

llvm-svn: 250127
This commit is contained in:
Rui Ueyama 2015-10-12 23:49:04 +00:00
parent 18255a333e
commit 63d8880b38
1 changed files with 6 additions and 1 deletions

View File

@ -19,6 +19,7 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/StringSaver.h"
#include <cctype>
using namespace llvm;
using namespace lld;
@ -138,8 +139,12 @@ void LinkerScript::expect(StringRef Expect) {
error(Expect + " expected, but got " + Tok);
}
static bool isDOSAbsolutePath(StringRef S) {
return isalpha(S[0]) && S.substr(1).startswith(":\\");
}
void LinkerScript::addFile(StringRef S) {
if (S.startswith("/")) {
if (S.startswith("/") || isDOSAbsolutePath(S)) {
Driver->addFile(S);
} else if (S.startswith("=")) {
if (Config->Sysroot.empty())