lib/Frontend/InitHeaderSearch.cpp: Tweak AddPath() to accept "/foo/bar" (not "X:\foo\bar") with -isysroot. test/PCH/reloc.c can pass.

FIXME: We should consider better isysroot scheme on Win32 hosts.
llvm-svn: 130683
This commit is contained in:
NAKAMURA Takumi 2011-05-02 04:50:10 +00:00
parent bb9ffbdc89
commit c3a8529269
2 changed files with 6 additions and 1 deletions

View File

@ -118,7 +118,12 @@ void InitHeaderSearch::AddPath(const llvm::Twine &Path,
// Handle isysroot.
if ((Group == System || Group == CXXSystem) && !IgnoreSysRoot &&
#if defined(_WIN32)
!MappedPathStr.empty() &&
llvm::sys::path::is_separator(MappedPathStr[0]) &&
#else
llvm::sys::path::is_absolute(MappedPathStr) &&
#endif
IsNotEmptyOrRoot) {
MappedPathStorage.clear();
MappedPathStr =

View File

@ -1,7 +1,7 @@
// RUN: %clang_cc1 -emit-pch -o %t -relocatable-pch -isysroot %S/libroot %S/libroot/usr/include/reloc.h
// RUN: %clang_cc1 -include-pch %t -isysroot %S/libroot %s -verify
// RUN: not %clang_cc1 -include-pch %t %s
// XFAIL: mingw,win32
#include <reloc.h>
int x = 2; // expected-error{{redefinition}}