diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2019-12-06 15:54:47 -0800 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2019-12-09 10:08:02 -0800 |
commit | bab9849963eb9b9f1fa03900e8c48a7c7d6fc305 (patch) | |
tree | 222869314e28f815136956e65100136d7644765e /clang/test/Driver/android-no-installed-libcxx.cpp | |
parent | be05633e28949139093278d5ce57a194756bfb83 (diff) | |
download | bcm5719-llvm-bab9849963eb9b9f1fa03900e8c48a7c7d6fc305.tar.gz bcm5719-llvm-bab9849963eb9b9f1fa03900e8c48a7c7d6fc305.zip |
Reland 198fbcb8, "Driver: Don't look for libc++ headers in the install directory on Android.", which was reverted in b3249027.
Fixed the test case to set --sysroot, which lets it succeed in the case where
a directory named "/usr/include/c++/v1" or "/usr/local/include/c++/v1" exists.
Original commit message:
> The NDK uses a separate set of libc++ headers in the sysroot. Any headers
> in the installation directory are not going to work on Android, not least
> because they use a different name for the inline namespace (std::__1 instead
> of std::__ndk1).
>
> This effectively makes it impossible to produce a single toolchain that is
> capable of targeting both Android and another platform that expects libc++
> headers to be installed in the installation directory, such as Mac.
>
> In order to allow this scenario to work, stop looking for headers in the
> install directory on Android.
Differential Revision: https://reviews.llvm.org/D71154
Diffstat (limited to 'clang/test/Driver/android-no-installed-libcxx.cpp')
-rw-r--r-- | clang/test/Driver/android-no-installed-libcxx.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Driver/android-no-installed-libcxx.cpp b/clang/test/Driver/android-no-installed-libcxx.cpp new file mode 100644 index 00000000000..a496a8289b9 --- /dev/null +++ b/clang/test/Driver/android-no-installed-libcxx.cpp @@ -0,0 +1,10 @@ +// Check that we don't find the libc++ in the installation directory when +// targeting Android. + +// RUN: mkdir -p %t/bin +// RUN: mkdir -p %t/include/c++/v1 +// RUN: mkdir -p %t/sysroot +// RUN: %clang -target aarch64-linux-android -ccc-install-dir %t/bin \ +// RUN: --sysroot=%t/sysroot -stdlib=libc++ -fsyntax-only \ +// RUN: %s -### 2>&1 | FileCheck %s +// CHECK-NOT: "-internal-isystem" "{{.*}}v1" |