Dmitri Gribenko wrote:

> On Sun, May 19, 2013 at 10:58 PM, Stephen Kelly
> <[email protected]> wrote:
>> Dmitri Gribenko wrote:
>>
>>> Please take a look at how test/Driver/linux-header-search.cpp uses
>>> test/Driver/Inputs/ubuntu_13.04_multiarch_tree.
>>>
>>
>> Thanks, I made some guesses at how the testsuite works, but I didn't
>> (find out how to) run it.
> 
> These regression tests (testsuite is a different thing in LLVM/Clang)
> can be run by 'make check-all' from the build dir.

That takes 26 seconds on my system and runs 5000 tests. What I really wanted 
was this:

 llvm/tools/clang/test$ /home/stephen/dev/src/llvm/utils/lit/lit.py --param 
build_mode=. -sv  . --filter linux-header-search

I had to debug a lot of "error: expected string not found in input", so 
waiting 30 seconds between runs does not make sense.

Updated patch attached.

Thanks,

Steve.
>From ed1b8a1864cf128419f13a46030cff9d20abe670 Mon Sep 17 00:00:00 2001
From: Stephen Kelly <[email protected]>
Date: Sun, 19 May 2013 21:09:16 +0200
Subject: [PATCH] Search for gcc in the gcc-cross directory.

Ubuntu stores cross-compiling relevant files there now.
---
 lib/Driver/ToolChains.cpp                                  |  3 +++
 .../usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/crtbegin.o   |  1 +
 test/Driver/linux-header-search.cpp                        | 14 ++++++++++++++
 3 files changed, 18 insertions(+)
 create mode 100644 test/Driver/Inputs/ubuntu_13.04_multiarch_tree/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/crtbegin.o

diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index fffba0e..f70e93e 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -1382,6 +1382,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
   // up to the lib directory.
   const std::string LibSuffixes[] = {
     "/gcc/" + CandidateTriple.str(),
+    // Ubuntu puts cross-compilers in gcc-cross
+    "/gcc-cross/" + CandidateTriple.str(),
     "/" + CandidateTriple.str() + "/gcc/" + CandidateTriple.str(),
 
     // The Freescale PPC SDK has the gcc libraries in
@@ -1396,6 +1398,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
   };
   const std::string InstallSuffixes[] = {
     "/../../..",
+    "/../../..",
     "/../../../..",
     "/../..",
     "/../../../.."
diff --git a/test/Driver/Inputs/ubuntu_13.04_multiarch_tree/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/crtbegin.o b/test/Driver/Inputs/ubuntu_13.04_multiarch_tree/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/crtbegin.o
new file mode 100644
index 0000000..c6cac69
--- /dev/null
+++ b/test/Driver/Inputs/ubuntu_13.04_multiarch_tree/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/crtbegin.o
@@ -0,0 +1 @@
+empty
diff --git a/test/Driver/linux-header-search.cpp b/test/Driver/linux-header-search.cpp
index d09f5b2..6217e7b 100644
--- a/test/Driver/linux-header-search.cpp
+++ b/test/Driver/linux-header-search.cpp
@@ -31,6 +31,20 @@
 // CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/include"
 // CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
 //
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN:     -target arm-linux-gnueabihf \
+// RUN:     --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-13-04-CROSS %s
+// CHECK-UBUNTU-13-04-CROSS: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
+// CHECK-UBUNTU-13-04-CROSS: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/c++/4.7"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/c++/4.7/backward"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/arm-linux-gnueabihf/c++/4.7"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "{{.*}}/lib{{(64|32)?}}/clang/{{[0-9]\.[0-9]}}/include"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-externc-isystem" "[[SYSROOT]]/include"
+// CHECK-UBUNTU-13-04-CROSS: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+//
 // Test Ubuntu/Debian's new version of multiarch, with -m32.
 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
 // RUN:     -target x86_64-unknown-linux-gnu -m32 \
-- 
1.8.1.2


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to