forked from OSchip/llvm-project
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:
parent
bb9ffbdc89
commit
c3a8529269
|
@ -118,7 +118,12 @@ void InitHeaderSearch::AddPath(const llvm::Twine &Path,
|
||||||
|
|
||||||
// Handle isysroot.
|
// Handle isysroot.
|
||||||
if ((Group == System || Group == CXXSystem) && !IgnoreSysRoot &&
|
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) &&
|
llvm::sys::path::is_absolute(MappedPathStr) &&
|
||||||
|
#endif
|
||||||
IsNotEmptyOrRoot) {
|
IsNotEmptyOrRoot) {
|
||||||
MappedPathStorage.clear();
|
MappedPathStorage.clear();
|
||||||
MappedPathStr =
|
MappedPathStr =
|
||||||
|
|
|
@ -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 -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: %clang_cc1 -include-pch %t -isysroot %S/libroot %s -verify
|
||||||
// RUN: not %clang_cc1 -include-pch %t %s
|
// RUN: not %clang_cc1 -include-pch %t %s
|
||||||
// XFAIL: mingw,win32
|
|
||||||
#include <reloc.h>
|
#include <reloc.h>
|
||||||
|
|
||||||
int x = 2; // expected-error{{redefinition}}
|
int x = 2; // expected-error{{redefinition}}
|
||||||
|
|
Loading…
Reference in New Issue