summaryrefslogtreecommitdiff
path: root/test/Driver/linux-header-search.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-09 03:46:20 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-09 03:46:20 +0000
commitd936d9d9abae0e5018fa0233aa51ac8390a6778f (patch)
tree1c9f1bf8fff78675534a3333921a47da40679715 /test/Driver/linux-header-search.cpp
parenta59e4b7fca1d46afd8f315fa87fa8bf1a68df9cd (diff)
downloadclang-d936d9d9abae0e5018fa0233aa51ac8390a6778f.tar.gz
Fix an issue that Duncan discovered on a specific (no longer current)
version of Ubuntu. It has a very broken multiarch configuration, and so we need special logic to handle it correctly. Fixing and testing this uncovered a few other trivial issues with the logic that are fixed as well. I added tests to cover this as it is hard to notice if you install recent versions of the OS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver/linux-header-search.cpp')
-rw-r--r--test/Driver/linux-header-search.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Driver/linux-header-search.cpp b/test/Driver/linux-header-search.cpp
new file mode 100644
index 0000000000..a2f486e307
--- /dev/null
+++ b/test/Driver/linux-header-search.cpp
@@ -0,0 +1,17 @@
+// General tests that the header search paths detected by the driver and passed
+// to CC1 are sane.
+//
+// Test a very broken version of multiarch that shipped in Ubuntu 11.04.
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN: -ccc-host-triple i386-unknown-linux \
+// RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
+// RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
+// CHECK-UBUNTU-11-04: "{{.*}}clang{{.*}}" "-cc1"
+// CHECK-UBUNTU-11-04: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5"
+// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/i686-linux-gnu"
+// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/backward"
+// CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
+// CHECK-UBUNTU-11-04: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9]\.[0-9]}}/include"
+// CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/include"
+// CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"