<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I've set up a windows machine and I'm working on a fix. Thanks for notifying me.<div class=""><div class=""><br class=""></div><div class="">Louis<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 21, 2019, at 21:06, Galina Kistanova <<a href="mailto:gkistanova@gmail.com" class="">gkistanova@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello Louis,<br class=""><br class="">This commit broke few tests on the next builder:<br class=""><a href="http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/17776" class="">http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/17776</a><br class="">Please have a look ASAP?<br class=""><br class="">. . .<br class="">Failing Tests (4):<br class=""> Clang :: Driver/darwin-header-search-libcxx.cpp<br class=""> Clang :: Driver/darwin-header-search-libstdcxx.cpp<br class=""> Clang :: Driver/darwin-header-search-system.cpp<br class=""> LLVM :: CodeGen/AMDGPU/regbank-reassign.mir<br class=""><br class="">The builder was already red and did not send any notifications.<br class=""><br class="">Thanks<br class=""><br class="">Galina</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 21, 2019 at 10:45 AM Louis Dionne via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: ldionne<br class="">
Date: Tue May 21 10:48:04 2019<br class="">
New Revision: 361278<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=361278&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=361278&view=rev</a><br class="">
Log:<br class="">
[clang][Darwin] Refactor header search path logic into the driver<br class="">
<br class="">
Summary:<br class="">
This commit moves the logic for determining system, resource and C++<br class="">
header search paths from CC1 to the driver. This refactor has already<br class="">
been made for several platforms, but Darwin had been left behind.<br class="">
<br class="">
This refactor tries to implement the previous search path logic with<br class="">
perfect accuracy. In particular, the order of all include paths inside<br class="">
CC1 and all paths that were skipped because nonexistent are conserved<br class="">
after the refactor. This change was also tested against a code base<br class="">
of significant size and revealed no problems.<br class="">
<br class="">
Reviewers: jfb, arphaman<br class="">
<br class="">
Subscribers: nemanjai, javed.absar, kbarton, christof, jkorous, dexonsmith, jsji, cfe-commits<br class="">
<br class="">
Tags: #clang<br class="">
<br class="">
Differential Revision: <a href="https://reviews.llvm.org/D61963" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/D61963</a><br class="">
<br class="">
Added:<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/i686-apple-darwin8/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/i686-apple-darwin8/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.2.1/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.2.1/i686-apple-darwin10/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/lib/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/lib/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/include/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/lib/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/lib/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/include/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/lib/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/lib/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/include/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/lib/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/lib/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/include/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/lib/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/lib/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/include/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/lib/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/lib/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/include/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/lib/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/lib/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/bin/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/bin/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/include/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/include/c++/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/include/c++/v1/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/include/c++/v1/.keep<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin/<br class="">
cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin/.keep<br class="">
cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp<br class="">
cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp<br class="">
cfe/trunk/test/Driver/darwin-header-search-system.cpp<br class="">
Removed:<br class="">
cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp<br class="">
Modified:<br class="">
cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td<br class="">
cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td<br class="">
cfe/trunk/lib/Driver/ToolChains/Darwin.cpp<br class="">
cfe/trunk/lib/Driver/ToolChains/Darwin.h<br class="">
cfe/trunk/lib/Frontend/InitHeaderSearch.cpp<br class="">
cfe/trunk/test/Driver/darwin-stdlib.cpp<br class="">
<br class="">
Modified: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=361278&r1=361277&r2=361278&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=361278&r1=361277&r2=361278&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td (original)<br class="">
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td Tue May 21 10:48:04 2019<br class="">
@@ -453,4 +453,9 @@ def warn_drv_msp430_hwmult_no_device : W<br class="">
"specify a MSP430 device, or -mhwmult to set hardware multiply type "<br class="">
"explicitly.">, InGroup<InvalidCommandLineArgument>;<br class="">
<br class="">
+def warn_drv_libstdcxx_not_found : Warning<<br class="">
+ "include path for libstdc++ headers not found; pass '-stdlib=libc++' on the "<br class="">
+ "command line to use the libc++ standard library instead">,<br class="">
+ InGroup<DiagGroup<"stdlibcxx-not-found">>;<br class="">
+<br class="">
}<br class="">
<br class="">
Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=361278&r1=361277&r2=361278&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=361278&r1=361277&r2=361278&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)<br class="">
+++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Tue May 21 10:48:04 2019<br class="">
@@ -232,11 +232,6 @@ def err_invalid_vfs_overlay : Error<<br class="">
def warn_option_invalid_ocl_version : Warning<<br class="">
"OpenCL version %0 does not support the option '%1'">, InGroup<Deprecated>;<br class="">
<br class="">
-def warn_stdlibcxx_not_found : Warning<<br class="">
- "include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the "<br class="">
- "command line to use the libc++ standard library instead">,<br class="">
- InGroup<DiagGroup<"stdlibcxx-not-found">>;<br class="">
-<br class="">
def err_builtin_needs_feature : Error<"%0 needs target feature %1">;<br class="">
def err_function_needs_feature : Error<<br class="">
"always_inline function %1 requires target feature '%2', but would "<br class="">
<br class="">
Modified: cfe/trunk/lib/Driver/ToolChains/Darwin.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Darwin.cpp?rev=361278&r1=361277&r2=361278&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Darwin.cpp?rev=361278&r1=361277&r2=361278&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/lib/Driver/ToolChains/Darwin.cpp (original)<br class="">
+++ cfe/trunk/lib/Driver/ToolChains/Darwin.cpp Tue May 21 10:48:04 2019<br class="">
@@ -11,6 +11,7 @@<br class="">
#include "CommonArgs.h"<br class="">
#include "clang/Basic/AlignedAllocation.h"<br class="">
#include "clang/Basic/ObjCRuntime.h"<br class="">
+#include "clang/Config/config.h"<br class="">
#include "clang/Driver/Compilation.h"<br class="">
#include "clang/Driver/Driver.h"<br class="">
#include "clang/Driver/DriverDiagnostic.h"<br class="">
@@ -1804,6 +1805,84 @@ void Darwin::AddDeploymentTarget(Derived<br class="">
}<br class="">
}<br class="">
<br class="">
+void DarwinClang::AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,<br class="">
+ llvm::opt::ArgStringList &CC1Args) const {<br class="">
+ const Driver &D = getDriver();<br class="">
+<br class="">
+ llvm::StringRef Sysroot = "/";<br class="">
+ if (const Arg *A = DriverArgs.getLastArg(options::OPT_isysroot))<br class="">
+ Sysroot = A->getValue();<br class="">
+<br class="">
+ bool NoStdInc = DriverArgs.hasArg(options::OPT_nostdinc);<br class="">
+ bool NoStdlibInc = DriverArgs.hasArg(options::OPT_nostdlibinc);<br class="">
+ bool NoBuiltinInc = DriverArgs.hasArg(options::OPT_nobuiltininc);<br class="">
+<br class="">
+ // Add <sysroot>/usr/local/include<br class="">
+ if (!NoStdInc && !NoStdlibInc) {<br class="">
+ SmallString<128> P(Sysroot);<br class="">
+ llvm::sys::path::append(P, "usr", "local", "include");<br class="">
+ addSystemInclude(DriverArgs, CC1Args, P);<br class="">
+ }<br class="">
+<br class="">
+ // Add the Clang builtin headers (<resource>/include)<br class="">
+ if (!NoStdInc && !NoBuiltinInc) {<br class="">
+ SmallString<128> P(D.ResourceDir);<br class="">
+ llvm::sys::path::append(P, "include");<br class="">
+ addSystemInclude(DriverArgs, CC1Args, P);<br class="">
+ }<br class="">
+<br class="">
+ if (NoStdInc || NoStdlibInc)<br class="">
+ return;<br class="">
+<br class="">
+ // Check for configure-time C include directories.<br class="">
+ llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS);<br class="">
+ if (!CIncludeDirs.empty()) {<br class="">
+ llvm::SmallVector<llvm::StringRef, 5> dirs;<br class="">
+ CIncludeDirs.split(dirs, ":");<br class="">
+ for (llvm::StringRef dir : dirs) {<br class="">
+ llvm::StringRef Prefix =<br class="">
+ llvm::sys::path::is_absolute(dir) ? llvm::StringRef(Sysroot) : "";<br class="">
+ addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);<br class="">
+ }<br class="">
+ } else {<br class="">
+ // Otherwise, add <sysroot>/usr/include.<br class="">
+ SmallString<128> P(Sysroot);<br class="">
+ llvm::sys::path::append(P, "usr", "include");<br class="">
+ addExternCSystemInclude(DriverArgs, CC1Args, P.str());<br class="">
+ }<br class="">
+}<br class="">
+<br class="">
+bool DarwinClang::AddGnuCPlusPlusIncludePaths(const llvm::opt::ArgList &DriverArgs,<br class="">
+ llvm::opt::ArgStringList &CC1Args,<br class="">
+ llvm::SmallString<128> Base,<br class="">
+ llvm::StringRef Version,<br class="">
+ llvm::StringRef ArchDir,<br class="">
+ llvm::StringRef BitDir) const {<br class="">
+ llvm::sys::path::append(Base, Version);<br class="">
+<br class="">
+ // Add the base dir<br class="">
+ addSystemInclude(DriverArgs, CC1Args, Base);<br class="">
+<br class="">
+ // Add the multilib dirs<br class="">
+ {<br class="">
+ llvm::SmallString<128> P = Base;<br class="">
+ if (!ArchDir.empty())<br class="">
+ llvm::sys::path::append(P, ArchDir);<br class="">
+ if (!BitDir.empty())<br class="">
+ llvm::sys::path::append(P, BitDir);<br class="">
+ addSystemInclude(DriverArgs, CC1Args, P);<br class="">
+ }<br class="">
+<br class="">
+ // Add the backward dir<br class="">
+ {<br class="">
+ llvm::SmallString<128> P = Base;<br class="">
+ llvm::sys::path::append(P, "backward");<br class="">
+ addSystemInclude(DriverArgs, CC1Args, P);<br class="">
+ }<br class="">
+<br class="">
+ return getVFS().exists(Base);<br class="">
+}<br class="">
+<br class="">
void DarwinClang::AddClangCXXStdlibIncludeArgs(<br class="">
const llvm::opt::ArgList &DriverArgs,<br class="">
llvm::opt::ArgStringList &CC1Args) const {<br class="">
@@ -1811,29 +1890,95 @@ void DarwinClang::AddClangCXXStdlibInclu<br class="">
// CC1Args.<br class="">
// FIXME: this should not be necessary, remove usages in the frontend<br class="">
// (e.g. HeaderSearchOptions::UseLibcxx) and don't pipe -stdlib.<br class="">
+ // Also check whether this is used for setting library search paths.<br class="">
ToolChain::AddClangCXXStdlibIncludeArgs(DriverArgs, CC1Args);<br class="">
<br class="">
if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||<br class="">
DriverArgs.hasArg(options::OPT_nostdincxx))<br class="">
return;<br class="">
<br class="">
+ llvm::SmallString<128> Sysroot;<br class="">
+ if (const Arg *A = DriverArgs.getLastArg(options::OPT_isysroot)) {<br class="">
+ Sysroot = A->getValue();<br class="">
+ } else {<br class="">
+ Sysroot = "/";<br class="">
+ }<br class="">
+<br class="">
switch (GetCXXStdlibType(DriverArgs)) {<br class="">
case ToolChain::CST_Libcxx: {<br class="">
- llvm::StringRef InstallDir = getDriver().getInstalledDir();<br class="">
- if (InstallDir.empty())<br class="">
- break;<br class="">
- // On Darwin, libc++ may be installed alongside the compiler in<br class="">
- // include/c++/v1.<br class="">
- // Get from 'foo/bin' to 'foo/include/c++/v1'.<br class="">
- SmallString<128> P = InstallDir;<br class="">
- // Note that InstallDir can be relative, so we have to '..' and not<br class="">
- // parent_path.<br class="">
- llvm::sys::path::append(P, "..", "include", "c++", "v1");<br class="">
- addSystemInclude(DriverArgs, CC1Args, P);<br class="">
+ // On Darwin, libc++ is installed alongside the compiler in<br class="">
+ // include/c++/v1, so get from '<install>/bin' to '<install>/include/c++/v1'.<br class="">
+ {<br class="">
+ llvm::SmallString<128> P = llvm::StringRef(getDriver().getInstalledDir());<br class="">
+ // Note that P can be relative, so we have to '..' and not parent_path.<br class="">
+ llvm::sys::path::append(P, "..", "include", "c++", "v1");<br class="">
+ addSystemInclude(DriverArgs, CC1Args, P);<br class="">
+ }<br class="">
+ // Also add <sysroot>/usr/include/c++/v1 unless -nostdinc is used,<br class="">
+ // to match the legacy behavior in CC1.<br class="">
+ if (!DriverArgs.hasArg(options::OPT_nostdinc)) {<br class="">
+ llvm::SmallString<128> P = Sysroot;<br class="">
+ llvm::sys::path::append(P, "usr", "include", "c++", "v1");<br class="">
+ addSystemInclude(DriverArgs, CC1Args, P);<br class="">
+ }<br class="">
break;<br class="">
}<br class="">
+<br class="">
case ToolChain::CST_Libstdcxx:<br class="">
- // FIXME: should we do something about it?<br class="">
+ llvm::SmallString<128> UsrIncludeCxx = Sysroot;<br class="">
+ llvm::sys::path::append(UsrIncludeCxx, "usr", "include", "c++");<br class="">
+<br class="">
+ llvm::Triple::ArchType arch = getTriple().getArch();<br class="">
+ bool IsBaseFound = true;<br class="">
+ switch (arch) {<br class="">
+ default: break;<br class="">
+<br class="">
+ case llvm::Triple::ppc:<br class="">
+ case llvm::Triple::ppc64:<br class="">
+ IsBaseFound = AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx,<br class="">
+ "4.2.1",<br class="">
+ "powerpc-apple-darwin10",<br class="">
+ arch == llvm::Triple::ppc64 ? "ppc64" : "");<br class="">
+ IsBaseFound |= AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx,<br class="">
+ "4.0.0", "powerpc-apple-darwin10",<br class="">
+ arch == llvm::Triple::ppc64 ? "ppc64" : "");<br class="">
+ break;<br class="">
+<br class="">
+ case llvm::Triple::x86:<br class="">
+ case llvm::Triple::x86_64:<br class="">
+ IsBaseFound = AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx,<br class="">
+ "4.2.1",<br class="">
+ "i686-apple-darwin10",<br class="">
+ arch == llvm::Triple::x86_64 ? "x86_64" : "");<br class="">
+ IsBaseFound |= AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx,<br class="">
+ "4.0.0", "i686-apple-darwin8",<br class="">
+ "");<br class="">
+ break;<br class="">
+<br class="">
+ case llvm::Triple::arm:<br class="">
+ case llvm::Triple::thumb:<br class="">
+ IsBaseFound = AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx,<br class="">
+ "4.2.1",<br class="">
+ "arm-apple-darwin10",<br class="">
+ "v7");<br class="">
+ IsBaseFound |= AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx,<br class="">
+ "4.2.1",<br class="">
+ "arm-apple-darwin10",<br class="">
+ "v6");<br class="">
+ break;<br class="">
+<br class="">
+ case llvm::Triple::aarch64:<br class="">
+ IsBaseFound = AddGnuCPlusPlusIncludePaths(DriverArgs, CC1Args, UsrIncludeCxx,<br class="">
+ "4.2.1",<br class="">
+ "arm64-apple-darwin10",<br class="">
+ "");<br class="">
+ break;<br class="">
+ }<br class="">
+<br class="">
+ if (!IsBaseFound) {<br class="">
+ getDriver().Diag(diag::warn_drv_libstdcxx_not_found);<br class="">
+ }<br class="">
+<br class="">
break;<br class="">
}<br class="">
}<br class="">
<br class="">
Modified: cfe/trunk/lib/Driver/ToolChains/Darwin.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Darwin.h?rev=361278&r1=361277&r2=361278&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Darwin.h?rev=361278&r1=361277&r2=361278&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/lib/Driver/ToolChains/Darwin.h (original)<br class="">
+++ cfe/trunk/lib/Driver/ToolChains/Darwin.h Tue May 21 10:48:04 2019<br class="">
@@ -503,6 +503,9 @@ public:<br class="">
const llvm::opt::ArgList &DriverArgs,<br class="">
llvm::opt::ArgStringList &CC1Args) const override;<br class="">
<br class="">
+ void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,<br class="">
+ llvm::opt::ArgStringList &CC1Args) const override;<br class="">
+<br class="">
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,<br class="">
llvm::opt::ArgStringList &CmdArgs) const override;<br class="">
<br class="">
@@ -529,6 +532,13 @@ private:<br class="">
llvm::opt::ArgStringList &CmdArgs,<br class="">
StringRef Sanitizer,<br class="">
bool shared = true) const;<br class="">
+<br class="">
+ bool AddGnuCPlusPlusIncludePaths(const llvm::opt::ArgList &DriverArgs,<br class="">
+ llvm::opt::ArgStringList &CC1Args,<br class="">
+ llvm::SmallString<128> Base,<br class="">
+ llvm::StringRef Version,<br class="">
+ llvm::StringRef ArchDir,<br class="">
+ llvm::StringRef BitDir) const;<br class="">
};<br class="">
<br class="">
} // end namespace toolchains<br class="">
<br class="">
Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=361278&r1=361277&r2=361278&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=361278&r1=361277&r2=361278&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)<br class="">
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Tue May 21 10:48:04 2019<br class="">
@@ -210,6 +210,10 @@ void InitHeaderSearch::AddDefaultCInclud<br class="">
const HeaderSearchOptions &HSOpts) {<br class="">
llvm::Triple::OSType os = triple.getOS();<br class="">
<br class="">
+ if (triple.isOSDarwin()) {<br class="">
+ llvm_unreachable("Include management is handled in the driver.");<br class="">
+ }<br class="">
+<br class="">
if (HSOpts.UseStandardSystemIncludes) {<br class="">
switch (os) {<br class="">
case llvm::Triple::CloudABI:<br class="">
@@ -365,49 +369,7 @@ void InitHeaderSearch::AddDefaultCPlusPl<br class="">
// FIXME: temporary hack: hard-coded paths.<br class="">
<br class="">
if (triple.isOSDarwin()) {<br class="">
- bool IsBaseFound = true;<br class="">
- switch (triple.getArch()) {<br class="">
- default: break;<br class="">
-<br class="">
- case llvm::Triple::ppc:<br class="">
- case llvm::Triple::ppc64:<br class="">
- IsBaseFound = AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",<br class="">
- "powerpc-apple-darwin10", "",<br class="">
- "ppc64", triple);<br class="">
- IsBaseFound |= AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0",<br class="">
- "powerpc-apple-darwin10", "",<br class="">
- "ppc64", triple);<br class="">
- break;<br class="">
-<br class="">
- case llvm::Triple::x86:<br class="">
- case llvm::Triple::x86_64:<br class="">
- IsBaseFound = AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1",<br class="">
- "i686-apple-darwin10", "",<br class="">
- "x86_64", triple);<br class="">
- IsBaseFound |= AddGnuCPlusPlusIncludePaths(<br class="">
- "/usr/include/c++/4.0.0", "i686-apple-darwin8", "", "", triple);<br class="">
- break;<br class="">
-<br class="">
- case llvm::Triple::arm:<br class="">
- case llvm::Triple::thumb:<br class="">
- IsBaseFound = AddGnuCPlusPlusIncludePaths(<br class="">
- "/usr/include/c++/4.2.1", "arm-apple-darwin10", "v7", "", triple);<br class="">
- IsBaseFound |= AddGnuCPlusPlusIncludePaths(<br class="">
- "/usr/include/c++/4.2.1", "arm-apple-darwin10", "v6", "", triple);<br class="">
- break;<br class="">
-<br class="">
- case llvm::Triple::aarch64:<br class="">
- IsBaseFound = AddGnuCPlusPlusIncludePaths(<br class="">
- "/usr/include/c++/4.2.1", "arm64-apple-darwin10", "", "", triple);<br class="">
- break;<br class="">
- }<br class="">
- // Warn when compiling pure C++ / Objective-C++ only.<br class="">
- if (!IsBaseFound &&<br class="">
- !(LangOpts.CUDA || LangOpts.OpenCL || LangOpts.RenderScript)) {<br class="">
- Headers.getDiags().Report(SourceLocation(),<br class="">
- diag::warn_stdlibcxx_not_found);<br class="">
- }<br class="">
- return;<br class="">
+ llvm_unreachable("Include management is handled in the driver.");<br class="">
}<br class="">
<br class="">
switch (os) {<br class="">
@@ -464,6 +426,16 @@ void InitHeaderSearch::AddDefaultInclude<br class="">
break;<br class="">
}<br class="">
<br class="">
+ // All header search logic is handled in the Driver for Darwin.<br class="">
+ if (triple.isOSDarwin()) {<br class="">
+ if (HSOpts.UseStandardSystemIncludes) {<br class="">
+ // Add the default framework include paths on Darwin.<br class="">
+ AddPath("/System/Library/Frameworks", System, true);<br class="">
+ AddPath("/Library/Frameworks", System, true);<br class="">
+ }<br class="">
+ return;<br class="">
+ }<br class="">
+<br class="">
if (Lang.CPlusPlus && !Lang.AsmPreprocessor &&<br class="">
HSOpts.UseStandardCXXIncludes && HSOpts.UseStandardSystemIncludes) {<br class="">
if (HSOpts.UseLibcxx) {<br class="">
@@ -474,14 +446,6 @@ void InitHeaderSearch::AddDefaultInclude<br class="">
}<br class="">
<br class="">
AddDefaultCIncludePaths(triple, HSOpts);<br class="">
-<br class="">
- // Add the default framework include paths on Darwin.<br class="">
- if (HSOpts.UseStandardSystemIncludes) {<br class="">
- if (triple.isOSDarwin()) {<br class="">
- AddPath("/System/Library/Frameworks", System, true);<br class="">
- AddPath("/Library/Frameworks", System, true);<br class="">
- }<br class="">
- }<br class="">
}<br class="">
<br class="">
/// RemoveDuplicates - If there are duplicate directory entries in the specified<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c++/4.2.1/arm64-apple-darwin10/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c%2B%2B/4.2.1/arm64-apple-darwin10/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/include/c%2B%2B/4.2.1/arm64-apple-darwin10/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_aarch64/usr/lib/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v6/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c%2B%2B/4.2.1/arm-apple-darwin10/v6/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c%2B%2B/4.2.1/arm-apple-darwin10/v6/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c++/4.2.1/arm-apple-darwin10/v7/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c%2B%2B/4.2.1/arm-apple-darwin10/v7/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/include/c%2B%2B/4.2.1/arm-apple-darwin10/v7/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_arm/usr/lib/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c%2B%2B/4.0.0/powerpc-apple-darwin10/ppc64/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c%2B%2B/4.0.0/powerpc-apple-darwin10/ppc64/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c%2B%2B/4.2.1/powerpc-apple-darwin10/ppc64/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/include/c%2B%2B/4.2.1/powerpc-apple-darwin10/ppc64/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_ppc/usr/lib/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.0.0/i686-apple-darwin8/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c%2B%2B/4.0.0/i686-apple-darwin8/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c%2B%2B/4.0.0/i686-apple-darwin8/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c%2B%2B/4.2.1/i686-apple-darwin10/x86_64/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/include/c%2B%2B/4.2.1/i686-apple-darwin10/x86_64/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/lib/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/lib/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_libstdcxx_x86/usr/lib/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/include/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/include/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/include/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/lib/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/lib/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libcxx/usr/lib/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/include/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/include/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/include/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/lib/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/lib/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_no_libstdcxx/usr/lib/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/include/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/include/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/include/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/lib/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/lib/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr/usr/lib/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/include/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/include/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/include/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/lib/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/lib/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/lib/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/include/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/include/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/include/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/lib/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/lib/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_and_usr_local/usr/local/lib/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/include/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/include/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/include/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/lib/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/lib/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_sdk_usr_local/usr/local/lib/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/bin/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/bin/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/bin/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/include/c++/v1/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/include/c%2B%2B/v1/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain/usr/include/c%2B%2B/v1/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin/.keep<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin/.keep?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin/.keep?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
(empty)<br class="">
<br class="">
Added: cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp (added)<br class="">
+++ cfe/trunk/test/Driver/darwin-header-search-libcxx.cpp Tue May 21 10:48:04 2019<br class="">
@@ -0,0 +1,78 @@<br class="">
+// General tests that the header search paths for libc++ detected by the driver<br class="">
+// and passed to CC1 are correct on Darwin platforms.<br class="">
+<br class="">
+// Check without a sysroot and without headers alongside the installation<br class="">
+// (no include path should be added, and no warning or error).<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -stdlib=libc++ \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \<br class="">
+// RUN: | FileCheck --check-prefix=CHECK-LIBCXX-NONE %s<br class="">
+// CHECK-LIBCXX-NONE: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+<br class="">
+// Check with only headers alongside the installation (those should be used,<br class="">
+// but we should still add /usr/include/c++/v1 after to preserve legacy).<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -stdlib=libc++ \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin \<br class="">
+// RUN: | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain --check-prefix=CHECK-LIBCXX-TOOLCHAIN-1 %s<br class="">
+// CHECK-LIBCXX-TOOLCHAIN-1: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBCXX-TOOLCHAIN-1: "-internal-isystem" "[[TOOLCHAIN]]/usr/bin/../include/c++/v1"<br class="">
+// CHECK-LIBCXX-TOOLCHAIN-1: "-internal-isystem" "/usr/include/c++/v1"<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -stdlib=libc++ \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_no_libcxx \<br class="">
+// RUN: | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain --check-prefix=CHECK-LIBCXX-TOOLCHAIN-2 %s<br class="">
+// CHECK-LIBCXX-TOOLCHAIN-2: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBCXX-TOOLCHAIN-2: "-internal-isystem" "[[TOOLCHAIN]]/usr/bin/../include/c++/v1"<br class="">
+<br class="">
+// Check with both headers in the sysroot and headers alongside the installation<br class="">
+// (the headers in <sysroot> should be added after the toolchain headers).<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -stdlib=libc++ \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin \<br class="">
+// RUN: -resource-dir=%S/Inputs/resource_dir \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr \<br class="">
+// RUN: -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain \<br class="">
+// RUN: --check-prefix=CHECK-LIBCXX-SYSROOT_AND_TOOLCHAIN-1 %s<br class="">
+// CHECK-LIBCXX-SYSROOT_AND_TOOLCHAIN-1: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBCXX-SYSROOT_AND_TOOLCHAIN-1: "-internal-isystem" "[[TOOLCHAIN]]/usr/bin/../include/c++/v1"<br class="">
+// CHECK-LIBCXX-SYSROOT_AND_TOOLCHAIN-1: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"<br class="">
+<br class="">
+// Make sure that using -nostdinc or -nostdlibinc will drop the non-toolchain<br class="">
+// C++ library include paths (so all except <toolchain>/usr/bin/../include/c++/v1).<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin \<br class="">
+// RUN: -resource-dir=%S/Inputs/resource_dir \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr \<br class="">
+// RUN: -nostdinc \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr \<br class="">
+// RUN: -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain \<br class="">
+// RUN: --check-prefix=CHECK-LIBCXX-NOSTDINC %s<br class="">
+// CHECK-LIBCXX-NOSTDINC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBCXX-NOSTDINC: "-internal-isystem" "[[TOOLCHAIN]]/usr/bin/../include/c++/v1"<br class="">
+// CHECK-LIBCXX-NOSTDINC-NOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin \<br class="">
+// RUN: -resource-dir=%S/Inputs/resource_dir \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr \<br class="">
+// RUN: -nostdinc \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr \<br class="">
+// RUN: -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain \<br class="">
+// RUN: --check-prefix=CHECK-LIBCXX-NOSTDLIBINC %s<br class="">
+// CHECK-LIBCXX-NOSTDLIBINC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBCXX-NOSTDLIBINC: "-internal-isystem" "[[TOOLCHAIN]]/usr/bin/../include/c++/v1"<br class="">
+// CHECK-LIBCXX-NOSTDLIBINC-NOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"<br class="">
<br class="">
Added: cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp (added)<br class="">
+++ cfe/trunk/test/Driver/darwin-header-search-libstdcxx.cpp Tue May 21 10:48:04 2019<br class="">
@@ -0,0 +1,118 @@<br class="">
+// General tests that the header search paths for libstdc++ detected by the<br class="">
+// driver and passed to CC1 are correct on Darwin platforms.<br class="">
+<br class="">
+// Check ppc and ppc64<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target ppc-apple-darwin \<br class="">
+// RUN: -stdlib=libstdc++ \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_libstdcxx_ppc \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_libstdcxx_ppc --check-prefix=CHECK-LIBSTDCXX-PPC %s<br class="">
+// CHECK-LIBSTDCXX-PPC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBSTDCXX-PPC: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1<br class="">
+// CHECK-LIBSTDCXX-PPC: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/powerpc-apple-darwin10"<br class="">
+// CHECK-LIBSTDCXX-PPC: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/backward"<br class="">
+// CHECK-LIBSTDCXX-PPC: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0"<br class="">
+// CHECK-LIBSTDCXX-PPC: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0/powerpc-apple-darwin10"<br class="">
+// CHECK-LIBSTDCXX-PPC: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0/backward"<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target ppc64-apple-darwin \<br class="">
+// RUN: -stdlib=libstdc++ \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_libstdcxx_ppc \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_libstdcxx_ppc --check-prefix=CHECK-LIBSTDCXX-PPC64 %s<br class="">
+// CHECK-LIBSTDCXX-PPC64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBSTDCXX-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1"<br class="">
+// CHECK-LIBSTDCXX-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/powerpc-apple-darwin10/ppc64"<br class="">
+// CHECK-LIBSTDCXX-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/backward"<br class="">
+// CHECK-LIBSTDCXX-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0"<br class="">
+// CHECK-LIBSTDCXX-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0/powerpc-apple-darwin10/ppc64"<br class="">
+// CHECK-LIBSTDCXX-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0/backward"<br class="">
+<br class="">
+// Check x86 and x86_64<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target i686-apple-darwin \<br class="">
+// RUN: -stdlib=libstdc++ \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_libstdcxx_x86 \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_libstdcxx_x86 --check-prefix=CHECK-LIBSTDCXX-X86 %s<br class="">
+// CHECK-LIBSTDCXX-X86: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBSTDCXX-X86: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1"<br class="">
+// CHECK-LIBSTDCXX-X86: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/i686-apple-darwin10"<br class="">
+// CHECK-LIBSTDCXX-X86: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/backward"<br class="">
+// CHECK-LIBSTDCXX-X86: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0"<br class="">
+// CHECK-LIBSTDCXX-X86: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0/i686-apple-darwin8"<br class="">
+// CHECK-LIBSTDCXX-X86: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0/backward"<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -stdlib=libstdc++ \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_libstdcxx_x86 \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_libstdcxx_x86 --check-prefix=CHECK-LIBSTDCXX-X86_64 %s<br class="">
+// CHECK-LIBSTDCXX-X86_64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBSTDCXX-X86_64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1"<br class="">
+// CHECK-LIBSTDCXX-X86_64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/i686-apple-darwin10/x86_64"<br class="">
+// CHECK-LIBSTDCXX-X86_64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/backward"<br class="">
+// CHECK-LIBSTDCXX-X86_64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0"<br class="">
+// CHECK-LIBSTDCXX-X86_64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0/i686-apple-darwin8"<br class="">
+// CHECK-LIBSTDCXX-X86_64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.0.0/backward"<br class="">
+<br class="">
+// Check arm and thumb<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target arm-apple-darwin \<br class="">
+// RUN: -stdlib=libstdc++ \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_libstdcxx_arm \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_libstdcxx_arm --check-prefix=CHECK-LIBSTDCXX-ARM %s<br class="">
+// CHECK-LIBSTDCXX-ARM: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBSTDCXX-ARM: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1"<br class="">
+// CHECK-LIBSTDCXX-ARM: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/arm-apple-darwin10/v7"<br class="">
+// CHECK-LIBSTDCXX-ARM: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/backward"<br class="">
+// CHECK-LIBSTDCXX-ARM: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1"<br class="">
+// CHECK-LIBSTDCXX-ARM: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/arm-apple-darwin10/v6"<br class="">
+// CHECK-LIBSTDCXX-ARM: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/backward"<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target arm-apple-darwin \<br class="">
+// RUN: -stdlib=libstdc++ \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_libstdcxx_arm \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_libstdcxx_arm --check-prefix=CHECK-LIBSTDCXX-THUMB %s<br class="">
+// CHECK-LIBSTDCXX-THUMB: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBSTDCXX-THUMB: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1"<br class="">
+// CHECK-LIBSTDCXX-THUMB: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/arm-apple-darwin10/v7"<br class="">
+// CHECK-LIBSTDCXX-THUMB: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/backward"<br class="">
+// CHECK-LIBSTDCXX-THUMB: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1"<br class="">
+// CHECK-LIBSTDCXX-THUMB: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/arm-apple-darwin10/v6"<br class="">
+// CHECK-LIBSTDCXX-THUMB: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/backward"<br class="">
+<br class="">
+// Check aarch64<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target arm64-apple-darwin \<br class="">
+// RUN: -stdlib=libstdc++ \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_libstdcxx_aarch64 \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_libstdcxx_aarch64 --check-prefix=CHECK-LIBSTDCXX-AARCH64 %s<br class="">
+// CHECK-LIBSTDCXX-AARCH64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-LIBSTDCXX-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1"<br class="">
+// CHECK-LIBSTDCXX-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/arm64-apple-darwin10"<br class="">
+// CHECK-LIBSTDCXX-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/4.2.1/backward"<br class="">
+<br class="">
+// Make sure we issue a warning when we can't find the path<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -stdlib=libstdc++ \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_no_libstdcxx \<br class="">
+// RUN: | FileCheck --check-prefix=CHECK-LIBSTDCXX-MISSING %s<br class="">
+// CHECK-LIBSTDCXX-MISSING: clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead<br class="">
+//<br class="">
+// RUN: %clang %s -target x86_64-apple-darwin -fsyntax-only 2>&1 \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_no_libstdcxx \<br class="">
+// RUN: -stdlib=libc++ \<br class="">
+// RUN: | FileCheck -allow-empty --check-prefix=CHECK-LIBSTDCXX-MISSING-1 %s<br class="">
+// CHECK-LIBSTDCXX-MISSING-1-NOT: warning<br class="">
+//<br class="">
+// RUN: %clang %s -target x86_64-apple-darwin -fsyntax-only 2>&1 \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_no_libstdcxx \<br class="">
+// RUN: | FileCheck -allow-empty --check-prefix=CHECK-LIBSTDCXX-MISSING-2 %s<br class="">
+// CHECK-LIBSTDCXX-MISSING-2-NOT: warning<br class="">
<br class="">
Added: cfe/trunk/test/Driver/darwin-header-search-system.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-header-search-system.cpp?rev=361278&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-header-search-system.cpp?rev=361278&view=auto</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/test/Driver/darwin-header-search-system.cpp (added)<br class="">
+++ cfe/trunk/test/Driver/darwin-header-search-system.cpp Tue May 21 10:48:04 2019<br class="">
@@ -0,0 +1,80 @@<br class="">
+// General tests that the system header search paths detected by the driver<br class="">
+// and passed to CC1 are correct on Darwin platforms.<br class="">
+<br class="">
+// Check system headers (everything below <sysroot> and <resource-dir>)<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \<br class="">
+// RUN: -resource-dir=%S/Inputs/resource_dir \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \<br class="">
+// RUN: -DRESOURCE=%S/Inputs/resource_dir \<br class="">
+// RUN: --check-prefix=CHECK-SYSTEM %s<br class="">
+// CHECK-SYSTEM: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-SYSTEM: "-internal-isystem" "[[SYSROOT]]/usr/local/include"<br class="">
+// CHECK-SYSTEM: "-internal-isystem" "[[RESOURCE]]/include"<br class="">
+// CHECK-SYSTEM: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"<br class="">
+<br class="">
+// Make sure that using -nobuiltininc will drop resource headers<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \<br class="">
+// RUN: -resource-dir=%S/Inputs/resource_dir \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \<br class="">
+// RUN: -nobuiltininc \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \<br class="">
+// RUN: -DRESOURCE=%S/Inputs/resource_dir \<br class="">
+// RUN: --check-prefix=CHECK-NOBUILTININC %s<br class="">
+// CHECK-NOBUILTININC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-NOBUILTININC: "-internal-isystem" "[[SYSROOT]]/usr/local/include"<br class="">
+// CHECK-NOBUILTININC-NOT: "-internal-isystem" "[[RESOURCE]]/include"<br class="">
+// CHECK-NOBUILTININC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"<br class="">
+<br class="">
+// Make sure that using -nostdlibinc will drop <sysroot>/usr/local/include and<br class="">
+// <sysroot>/usr/include.<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \<br class="">
+// RUN: -resource-dir=%S/Inputs/resource_dir \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \<br class="">
+// RUN: -nostdlibinc \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \<br class="">
+// RUN: -DRESOURCE=%S/Inputs/resource_dir \<br class="">
+// RUN: --check-prefix=CHECK-NOSTDLIBINC %s<br class="">
+// CHECK-NOSTDLIBINC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-NOSTDLIBINC-NOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"<br class="">
+// CHECK-NOSTDLIBINC: "-internal-isystem" "[[RESOURCE]]/include"<br class="">
+// CHECK-NOSTDLIBINC-NOT: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"<br class="">
+<br class="">
+// Make sure that -nostdinc drops all the system include paths, including<br class="">
+// <resource>/include.<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \<br class="">
+// RUN: -resource-dir=%S/Inputs/resource_dir \<br class="">
+// RUN: -isysroot %S/Inputs/basic_darwin_sdk_usr_and_usr_local \<br class="">
+// RUN: -nostdinc \<br class="">
+// RUN: | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_and_usr_local \<br class="">
+// RUN: -DRESOURCE=%S/Inputs/resource_dir \<br class="">
+// RUN: --check-prefix=CHECK-NOSTDINC %s<br class="">
+// CHECK-NOSTDINC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-NOSTDINC-NOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"<br class="">
+// CHECK-NOSTDINC-NOT: "-internal-isystem" "[[RESOURCE]]/include"<br class="">
+// CHECK-NOSTDINC-NOT: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"<br class="">
+<br class="">
+// Check search paths without -isysroot<br class="">
+//<br class="">
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \<br class="">
+// RUN: -target x86_64-apple-darwin \<br class="">
+// RUN: -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \<br class="">
+// RUN: -resource-dir=%S/Inputs/resource_dir \<br class="">
+// RUN: | FileCheck -DRESOURCE=%S/Inputs/resource_dir \<br class="">
+// RUN: --check-prefix=CHECK-NOSYSROOT %s<br class="">
+// CHECK-NOSYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"<br class="">
+// CHECK-NOSYSROOT: "-internal-isystem" "/usr/local/include"<br class="">
+// CHECK-NOSYSROOT: "-internal-isystem" "[[RESOURCE]]/include"<br class="">
+// CHECK-NOSYSROOT: "-internal-externc-isystem" "/usr/include"<br class="">
<br class="">
Modified: cfe/trunk/test/Driver/darwin-stdlib.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-stdlib.cpp?rev=361278&r1=361277&r2=361278&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/darwin-stdlib.cpp?rev=361278&r1=361277&r2=361278&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/test/Driver/darwin-stdlib.cpp (original)<br class="">
+++ cfe/trunk/test/Driver/darwin-stdlib.cpp Tue May 21 10:48:04 2019<br class="">
@@ -3,19 +3,12 @@<br class="">
// XFAIL: default-cxx-stdlib-set<br class="">
<br class="">
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch arm64 -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX<br class="">
-// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.8 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBSTDCXX<br class="">
+// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.8 -Wno-stdlibcxx-not-found %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBSTDCXX<br class="">
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -mmacosx-version-min=10.9 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX<br class="">
-// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=6.1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBSTDCXX<br class="">
+// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=6.1 -Wno-stdlibcxx-not-found %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBSTDCXX<br class="">
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7s -miphoneos-version-min=7.0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX<br class="">
// RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %S/Inputs/darwin_toolchain_tree/bin/ -arch armv7k %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LIBCXX<br class="">
<br class="">
-// The purpose of this test is that the libc++ headers should be found<br class="">
-// properly. We also pass -stdlib=libc++ to make sure the logic to add the<br class="">
-// optional absolute include for libc++ from InitHeaderSearch.cpp also fires.<br class="">
-<br class="">
// CHECK-LIBCXX: "-stdlib=libc++"<br class="">
-// CHECK-LIBCXX: "-internal-isystem" "{{[^"]*}}{{/|\\\\}}Inputs{{/|\\\\}}darwin_toolchain_tree{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"<br class="">
-<br class="">
// CHECK-LIBSTDCXX-NOT: -stdlib=libc++<br class="">
// CHECK-LIBSTDCXX-NOT: -stdlib=libstdc++<br class="">
-// CHECK-LIBSTDCXX-NOT: -internal-isystem<br class="">
<br class="">
Removed: cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp?rev=361277&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp?rev=361277&view=auto</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp (original)<br class="">
+++ cfe/trunk/test/Frontend/warning-stdlibcxx-darwin.cpp (removed)<br class="">
@@ -1,6 +0,0 @@<br class="">
-// RUN: %clang -cc1 -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist %s 2>&1 | FileCheck %s<br class="">
-// RUN: %clang -cc1 -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist -stdlib=libc++ %s -verify<br class="">
-// RUN: %clang -cc1 -x c++-cpp-output -triple arm64-apple-ios6.0.0 -isysroot %S/doesnotexist %s -verify<br class="">
-// CHECK: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead<br class="">
-<br class="">
-// expected-no-diagnostics<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
cfe-commits mailing list<br class="">
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></div></body></html>