-isysroot is the flag which set the system root directory.
This bug report https://bugs.llvm.org//show_bug.cgi?id=11503
shows that -isysroot is not handled at all on Unix, so fixed this bug.
After this diff, I could get this result https://pastebin.com/TeCmn9mj .
Differential Revision: https://reviews.llvm.org/D31495
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301998
91177308-0d34-0410-b5e6-
96231b3b80d8
frontend::IncludeDirGroup Group = frontend::System;
if (A->getOption().matches(OPT_internal_externc_isystem))
Group = frontend::ExternCSystem;
- Opts.AddPath(A->getValue(), Group, false, true);
+ Opts.AddPath(A->getValue(), Group, false, false);
}
// Add the path prefixes which are implicitly treated as being system headers.
// RUN: FileCheck %s -check-prefix=SYSROOT_SEPARATE
// SYSROOT_SEPARATE: "-isysroot" "{{[^"]*}}/foo/bar"
// SYSROOT_SEPARATE: "--sysroot{{" "|=}}{{[^"]*}}/foo/bar"
+
+// Check that -isysroot is handled properly
+// RUN: %clang -isysroot /foo/bar -c %s -v 2>&1 | \
+// RUN: grep "/foo/bar"