summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/android-ndk-standalone.cpp
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2018-04-24 21:18:37 +0000
committerDan Albert <danalbert@google.com>2018-04-24 21:18:37 +0000
commit2368aed43c33988acf9c14c0b9fb6a2fc1c7b665 (patch)
treea29714b3e242e6fda2f300b4490e1c484f346fe6 /clang/test/Driver/android-ndk-standalone.cpp
parent3c148720faa8c4dbc76fde108a3e21f211c32d8a (diff)
downloadbcm5719-llvm-2368aed43c33988acf9c14c0b9fb6a2fc1c7b665.tar.gz
bcm5719-llvm-2368aed43c33988acf9c14c0b9fb6a2fc1c7b665.zip
[Driver] Android triples are not aliases for other triples.
Summary: Android targets should never use tools/libraries for non-Android targets or vice versa. Reviewers: srhines, george.burgess.iv, eugenis Reviewed By: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45597 llvm-svn: 330770
Diffstat (limited to 'clang/test/Driver/android-ndk-standalone.cpp')
-rw-r--r--clang/test/Driver/android-ndk-standalone.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/test/Driver/android-ndk-standalone.cpp b/clang/test/Driver/android-ndk-standalone.cpp
index fb5ce25659d..ff2f39defc9 100644
--- a/clang/test/Driver/android-ndk-standalone.cpp
+++ b/clang/test/Driver/android-ndk-standalone.cpp
@@ -302,3 +302,38 @@
// CHECK-X86_64: "-L{{.*}}/sysroot/usr/lib/x86_64-linux-android/21"
// CHECK-X86_64: "-L{{.*}}/sysroot/usr/lib/x86_64-linux-android"
// CHECK-X86_64: "-L{{.*}}/lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/lib"
+
+// We need two sets of tests to verify that we both don't find non-Android
+// toolchains installations and that we *do* find Android toolchains. We can't
+// do both at the same time in this environment because we need to pass
+// --sysroot to find the toolchains which would override searching in /usr. In a
+// production environment --sysroot is not used and the toolchains are instead
+// found relative to the clang binary, so both would be considered.
+
+// RUN: %clang -v --target=i686-linux-android \
+// RUN: 2>&1 | FileCheck --check-prefix=CHECK-I686-GCC-NOSYS %s
+//
+// CHECK-I686-GCC-NOSYS-NOT: Found candidate GCC installation: /usr{{.*}}
+//
+// RUN: %clang -v --target=i686-linux-android \
+// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree \
+// RUN: 2>&1 | FileCheck --check-prefix=CHECK-I686-GCC %s
+//
+// CHECK-I686-GCC-NOT: Found candidate GCC installation: /usr{{.*}}
+// CHECK-I686-GCC: Found candidate GCC installation: {{.*}}i686-linux-android/4.9
+// CHECK-I686-GCC-NEXT: Found candidate GCC installation: {{.*}}x86_64-linux-android/4.9
+// CHECK-I686-GCC-NEXT: Selected GCC installation: {{.*}}i686-linux-android/4.9
+
+// RUN: %clang -v --target=x86_64-linux-android \
+// RUN: 2>&1 | FileCheck --check-prefix=CHECK-X86_64-GCC-NOSYS %s
+//
+// CHECK-X86_64-GCC-NOSYS-NOT: Found candidate GCC installation: /usr{{.*}}
+
+// RUN: %clang -v --target=x86_64-linux-android \
+// RUN: --sysroot=%S/Inputs/basic_android_ndk_tree \
+// RUN: 2>&1 | FileCheck --check-prefix=CHECK-X86_64-GCC %s
+//
+// CHECK-X86_64-GCC-NOT: Found candidate GCC installation: /usr{{.*}}
+// CHECK-X86_64-GCC: Found candidate GCC installation: {{.*}}i686-linux-android/4.9
+// CHECK-X86_64-GCC-NEXT: Found candidate GCC installation: {{.*}}x86_64-linux-android/4.9
+// CHECK-X86_64-GCC-NEXT: Selected GCC installation: {{.*}}x86_64-linux-android/4.9
OpenPOWER on IntegriCloud