diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-10-05 01:01:57 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-10-05 01:01:57 +0000 |
commit | 5058e3a18c5f305d7ff21ba1e9e1439701d40e0b (patch) | |
tree | 16f498f2fe071bdf80b032502e7a88859a378c0a /test/Driver/linux-ld.c | |
parent | 53c8167d7a007daae87f342c0fedd03f1dcf1b62 (diff) |
Implement the feature I was originally driving toward when I started
this saga. Teach the driver to detect a GCC installed along side Clang
using the existing InstalledDir support in the Clang driver. This makes
a lot of Clang's behavior more automatic when it is installed along side
GCC.
Also include the first test cases (more to come, honest) which test both
the install directory behavior, and the version sorting behavior to show
that we're actually searching for the best candidate GCC installation
now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver/linux-ld.c')
-rw-r--r-- | test/Driver/linux-ld.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c index a7319fbb18..cd89c79809 100644 --- a/test/Driver/linux-ld.c +++ b/test/Driver/linux-ld.c @@ -90,3 +90,23 @@ // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." // CHECK-64-TO-32: "-L[[SYSROOT]]/lib" // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -ccc-host-triple i386-unknown-linux -m32 \ +// RUN: -ccc-install-dir %S/Inputs/fake_install_tree \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-32 %s +// CHECK-INSTALL-DIR-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-INSTALL-DIR-32: "{{.*}}/Inputs/fake_install_tree/lib/gcc/i386-unknown-linux/4.7.0/crtbegin.o" +// CHECK-INSTALL-DIR-32: "-L{{.*}}/Inputs/fake_install_tree/lib/gcc/i386-unknown-linux/4.7.0" +// +// Check that with 64-bit builds, we don't actually use the install directory +// as its version of GCC is lower than our sysrooted version. +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: -ccc-host-triple x86_64-unknown-linux -m64 \ +// RUN: -ccc-install-dir %S/Inputs/fake_install_tree \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-64 %s +// CHECK-INSTALL-DIR-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-INSTALL-DIR-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/crtbegin.o" +// CHECK-INSTALL-DIR-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" |