aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLogan Chien <tzuhsiang.chien@gmail.com>2012-12-06 22:59:37 +0000
committerLogan Chien <tzuhsiang.chien@gmail.com>2012-12-06 22:59:37 +0000
commitcd15652e632dea25ba5157dcef13963b7b0b79ea (patch)
treeab7136e248894d8fe52922740a4c79468bb9163e
parent850532c7882e901623e482295d4d227f31ccf269 (diff)
Add i686-linux-android for gcc toolchain detection.
* Look for i686-linux-android under <sysroot>/lib/gcc. * This patch also slightly enhance the test suite for Android GCC toolchain detection. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169557 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Driver/ToolChains.cpp1
-rwxr-xr-xtest/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/as0
-rwxr-xr-xtest/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/ld0
-rwxr-xr-xtest/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ar0
-rwxr-xr-xtest/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ld0
-rwxr-xr-xtest/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/as0
-rwxr-xr-xtest/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/ld0
-rw-r--r--test/Driver/android.c21
-rw-r--r--test/Driver/linux-ld.c8
9 files changed, 26 insertions, 4 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 179f0fd116..5bfd71427c 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -1094,6 +1094,7 @@ Generic_GCC::GCCInstallationDetector::GCCInstallationDetector(
"i686-pc-linux-gnu",
"i486-linux-gnu",
"i386-linux-gnu",
+ "i686-linux-android",
"i686-redhat-linux",
"i586-redhat-linux",
"i386-redhat-linux",
diff --git a/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/as b/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/as
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/as
diff --git a/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/ld b/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/ld
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/Driver/Inputs/basic_android_tree/arm-linux-androideabi/bin/ld
diff --git a/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ar b/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ar
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ar
diff --git a/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ld b/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ld
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/Driver/Inputs/basic_android_tree/i686-linux-android/bin/ld
diff --git a/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/as b/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/as
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/as
diff --git a/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/ld b/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/ld
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/Driver/Inputs/basic_android_tree/mipsel-linux-android/bin/ld
diff --git a/test/Driver/android.c b/test/Driver/android.c
new file mode 100644
index 0000000000..cd61a19010
--- /dev/null
+++ b/test/Driver/android.c
@@ -0,0 +1,21 @@
+// Test Android Toolchain Detection
+
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o \
+// RUN: -target arm-linux-androideabi \
+// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ANDROID-ARM %s
+// CHECK-ANDROID-ARM: "{{.*}}/Inputs/basic_android_tree/{{.*}}/arm-linux-androideabi/bin/as"
+// CHECK-ANDROID-ARM: "{{.*}}/Inputs/basic_android_tree/{{.*}}/arm-linux-androideabi/bin/ld"
+
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o \
+// RUN: -target mipsel-linux-android \
+// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ANDROID-MIPS %s
+// CHECK-ANDROID-MIPS: "{{.*}}/Inputs/basic_android_tree/{{.*}}/mipsel-linux-android/bin/as"
+// CHECK-ANDROID-MIPS: "{{.*}}/Inputs/basic_android_tree/{{.*}}/mipsel-linux-android/bin/ld"
+
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o \
+// RUN: -target i686-linux-android \
+// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-ANDROID-X86 %s
+// CHECK-ANDROID-X86: "{{.*}}/Inputs/basic_android_tree/{{.*}}/i686-linux-android/bin/ld"
diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c
index 06be358860..c0ea45d5a8 100644
--- a/test/Driver/linux-ld.c
+++ b/test/Driver/linux-ld.c
@@ -412,7 +412,7 @@
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-linux-android \
+// RUN: -target i686-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
// CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
@@ -439,7 +439,7 @@
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-linux-android \
+// RUN: -target i686-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -shared \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
@@ -468,7 +468,7 @@
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-linux-android \
+// RUN: -target i686-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -static \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
@@ -496,7 +496,7 @@
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-// RUN: -target i386-linux-android \
+// RUN: -target i686-linux-android \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: -pie \
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s