r239154 - [SPARC] Add multiarch include paths.

James Y Knight jyknight at google.com
Fri Jun 5 06:44:43 PDT 2015


Author: jyknight
Date: Fri Jun  5 08:44:43 2015
New Revision: 239154

URL: http://llvm.org/viewvc/llvm-project?rev=239154&view=rev
Log:
[SPARC] Add multiarch include paths.

Adds tests verifying the proper dirs are found in the Debian 8/GCC4.9
layout for sparc (32bit), sparc (32bit) with lib64 multilib, and
sparc64.

The test cases added here also cover r239047, which fixed the linker
paths.

Added:
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/lib/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/lib/sparc64-linux-gnu/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/lib/sparc64-linux-gnu/.keep
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/lib64/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/lib64/.keep
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/c++/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/c++/4.9/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/c++/4.9/.keep
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/sparc64-linux-gnu/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/sparc64-linux-gnu/c++/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/sparc64-linux-gnu/c++/4.9/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/sparc64-linux-gnu/c++/4.9/.keep
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/gcc/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/gcc/sparc64-linux-gnu/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/gcc/sparc64-linux-gnu/4.9/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/gcc/sparc64-linux-gnu/4.9/crtbegin.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/gcc/sparc64-linux-gnu/4.9/crtend.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/sparc64-linux-gnu/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/sparc64-linux-gnu/crt1.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/sparc64-linux-gnu/crti.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/sparc64-linux-gnu/crtn.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/lib/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/lib/sparc-linux-gnu/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/lib/sparc-linux-gnu/.keep
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/lib64/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/lib64/.keep
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/c++/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/c++/4.9/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/c++/4.9/backward/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/c++/4.9/backward/.keep
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/sparc-linux-gnu/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/sparc-linux-gnu/c++/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/sparc-linux-gnu/c++/4.9/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/sparc-linux-gnu/c++/4.9/64/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/sparc-linux-gnu/c++/4.9/64/.keep
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/64/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/64/crtbegin.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/64/crtend.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/crtbegin.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/crtend.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/sparc-linux-gnu/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/sparc-linux-gnu/crt1.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/sparc-linux-gnu/crti.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/sparc-linux-gnu/crtn.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib64/
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib64/crt1.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib64/crti.o
    cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib64/crtn.o
Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp
    cfe/trunk/test/Driver/linux-header-search.cpp
    cfe/trunk/test/Driver/linux-ld.c

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=239154&r1=239153&r2=239154&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Jun  5 08:44:43 2015
@@ -3475,6 +3475,12 @@ void Linux::AddClangSystemIncludeArgs(co
   const StringRef PPC64LEMultiarchIncludeDirs[] = {
     "/usr/include/powerpc64le-linux-gnu"
   };
+  const StringRef SparcMultiarchIncludeDirs[] = {
+    "/usr/include/sparc-linux-gnu"
+  };
+  const StringRef Sparc64MultiarchIncludeDirs[] = {
+    "/usr/include/sparc64-linux-gnu"
+  };
   ArrayRef<StringRef> MultiarchIncludeDirs;
   if (getTriple().getArch() == llvm::Triple::x86_64) {
     MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
@@ -3502,6 +3508,10 @@ void Linux::AddClangSystemIncludeArgs(co
     MultiarchIncludeDirs = PPC64MultiarchIncludeDirs;
   } else if (getTriple().getArch() == llvm::Triple::ppc64le) {
     MultiarchIncludeDirs = PPC64LEMultiarchIncludeDirs;
+  } else if (getTriple().getArch() == llvm::Triple::sparc) {
+    MultiarchIncludeDirs = SparcMultiarchIncludeDirs;
+  } else if (getTriple().getArch() == llvm::Triple::sparcv9) {
+    MultiarchIncludeDirs = Sparc64MultiarchIncludeDirs;
   }
   for (StringRef Dir : MultiarchIncludeDirs) {
     if (llvm::sys::fs::exists(SysRoot + Dir)) {

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/lib/sparc64-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/lib/sparc64-linux-gnu/.keep?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/lib64/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/lib64/.keep?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/c++/4.9/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/c%2B%2B/4.9/.keep?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/sparc64-linux-gnu/c++/4.9/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/include/sparc64-linux-gnu/c%2B%2B/4.9/.keep?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/gcc/sparc64-linux-gnu/4.9/crtbegin.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/gcc/sparc64-linux-gnu/4.9/crtbegin.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/gcc/sparc64-linux-gnu/4.9/crtend.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/gcc/sparc64-linux-gnu/4.9/crtend.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/sparc64-linux-gnu/crt1.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/sparc64-linux-gnu/crt1.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/sparc64-linux-gnu/crti.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/sparc64-linux-gnu/crti.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/sparc64-linux-gnu/crtn.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc64_tree/usr/lib/sparc64-linux-gnu/crtn.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/lib/sparc-linux-gnu/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/lib/sparc-linux-gnu/.keep?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/lib64/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/lib64/.keep?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/c++/4.9/backward/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/c%2B%2B/4.9/backward/.keep?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/sparc-linux-gnu/c++/4.9/64/.keep
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/include/sparc-linux-gnu/c%2B%2B/4.9/64/.keep?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/64/crtbegin.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/64/crtbegin.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/64/crtend.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/64/crtend.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/crtbegin.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/crtbegin.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/crtend.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/gcc/sparc-linux-gnu/4.9/crtend.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/sparc-linux-gnu/crt1.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/sparc-linux-gnu/crt1.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/sparc-linux-gnu/crti.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/sparc-linux-gnu/crti.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/sparc-linux-gnu/crtn.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib/sparc-linux-gnu/crtn.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib64/crt1.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib64/crt1.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib64/crti.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib64/crti.o?rev=239154&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib64/crtn.o
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Inputs/debian_8_sparc_multilib_tree/usr/lib64/crtn.o?rev=239154&view=auto
==============================================================================
    (empty)

Modified: cfe/trunk/test/Driver/linux-header-search.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-header-search.cpp?rev=239154&r1=239153&r2=239154&view=diff
==============================================================================
--- cfe/trunk/test/Driver/linux-header-search.cpp (original)
+++ cfe/trunk/test/Driver/linux-header-search.cpp Fri Jun  5 08:44:43 2015
@@ -285,3 +285,60 @@
 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/mips64el-linux-gnuabi64"
 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/include"
 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+
+// Check header search on Debian 8 / Sparc
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN:     -target sparc-unknown-linux-gnu \
+// RUN:     --sysroot=%S/Inputs/debian_8_sparc_multilib_tree \
+// RUN:     --gcc-toolchain="" \
+// RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC32 %s
+// CHECK-DEBIAN-SPARC32: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
+// CHECK-DEBIAN-SPARC32: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
+// CHECK-DEBIAN-SPARC32: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-DEBIAN-SPARC32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/c++/4.9"
+// CHECK-DEBIAN-SPARC32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/sparc-linux-gnu/c++/4.9"
+// CHECK-DEBIAN-SPARC32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/c++/4.9/backward"
+// CHECK-DEBIAN-SPARC32: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
+// CHECK-DEBIAN-SPARC32: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
+// CHECK-DEBIAN-SPARC32: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/sparc-linux-gnu"
+// CHECK-DEBIAN-SPARC32: "-internal-externc-isystem" "[[SYSROOT]]/include"
+// CHECK-DEBIAN-SPARC32: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+
+// Check header search on Debian 8 / Sparc, with the oldstyle multilib packages
+// RUN: %clang -no-canonical-prefixes -m64 %s -### -fsyntax-only 2>&1 \
+// RUN:     -target sparc-unknown-linux-gnu \
+// RUN:     --sysroot=%S/Inputs/debian_8_sparc_multilib_tree \
+// RUN:     --gcc-toolchain="" \
+// RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC32-LIB64 %s
+// CHECK-DEBIAN-SPARC32-LIB64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
+// CHECK-DEBIAN-SPARC32-LIB64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
+// CHECK-DEBIAN-SPARC32-LIB64: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-DEBIAN-SPARC32-LIB64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/c++/4.9"
+// CHECK-DEBIAN-SPARC32-LIB64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/sparc-linux-gnu/c++/4.9/64"
+// CHECK-DEBIAN-SPARC32-LIB64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/c++/4.9/backward"
+// CHECK-DEBIAN-SPARC32-LIB64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
+// CHECK-DEBIAN-SPARC32-LIB64: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
+/* TODO: GCC 4.9 includes the following dir in its search path, which
+   seems questionable. Clang doesn't. Not sure if clang should be
+   doing that too. */
+// CHECK-DEBIAN-SPARC32-LIB64-todo: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/sparc-linux-gnu"
+// CHECK-DEBIAN-SPARC32-LIB64: "-internal-externc-isystem" "[[SYSROOT]]/include"
+// CHECK-DEBIAN-SPARC32-LIB64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+
+// Check header search on Debian 8 / Sparc64
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
+// RUN:     -target sparc64-unknown-linux-gnu \
+// RUN:     --sysroot=%S/Inputs/debian_8_sparc64_tree \
+// RUN:     --gcc-toolchain="" \
+// RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC64 %s
+// CHECK-DEBIAN-SPARC64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
+// CHECK-DEBIAN-SPARC64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
+// CHECK-DEBIAN-SPARC64: "-isysroot" "[[SYSROOT:[^"]+]]"
+// CHECK-DEBIAN-SPARC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../../include/c++/4.9"
+// CHECK-DEBIAN-SPARC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../../include/sparc64-linux-gnu/c++/4.9"
+// CHECK-DEBIAN-SPARC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../../include/c++/4.9/backward"
+// CHECK-DEBIAN-SPARC64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
+// CHECK-DEBIAN-SPARC64: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
+// CHECK-DEBIAN-SPARC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/sparc64-linux-gnu"
+// CHECK-DEBIAN-SPARC64: "-internal-externc-isystem" "[[SYSROOT]]/include"
+// CHECK-DEBIAN-SPARC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"

Modified: cfe/trunk/test/Driver/linux-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-ld.c?rev=239154&r1=239153&r2=239154&view=diff
==============================================================================
--- cfe/trunk/test/Driver/linux-ld.c (original)
+++ cfe/trunk/test/Driver/linux-ld.c Fri Jun  5 08:44:43 2015
@@ -904,6 +904,67 @@
 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/lib"
 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib"
 //
+// Check linker paths on Debian 8 / Sparc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN:     --target=sparc-linux-gnu \
+// RUN:     --gcc-toolchain="" \
+// RUN:     --sysroot=%S/Inputs/debian_8_sparc_multilib_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC32 %s
+// CHECK-DEBIAN-SPARC32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu/crt1.o"
+// CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu/crti.o"
+// CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/crtbegin.o"
+// CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9"
+// CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu"
+// CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib"
+// CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/lib/sparc-linux-gnu"
+// CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/sparc-linux-gnu"
+// CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/lib"
+// CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib"
+// CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/crtend.o"
+// CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu/crtn.o"
+//
+// Check linker paths on Debian 8 / Sparc, with the oldstyle multilib packages
+// RUN: %clang -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 \
+// RUN:     --target=sparc-linux-gnu \
+// RUN:     --gcc-toolchain="" \
+// RUN:     --sysroot=%S/Inputs/debian_8_sparc_multilib_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC32-LIB64 %s
+// CHECK-DEBIAN-SPARC32-LIB64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64/crt1.o"
+// CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64/crti.o"
+// CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/64/crtbegin.o"
+// CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/64"
+// CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64"
+// CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/lib/../lib64"
+// CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/../lib64"
+// CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9"
+// CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/lib"
+// CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib"
+// CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/64/crtend.o"
+// CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64/crtn.o"
+//
+// Check linker paths on Debian 8 / Sparc64
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN:     --target=sparc64-linux-gnu \
+// RUN:     --gcc-toolchain="" \
+// RUN:     --sysroot=%S/Inputs/debian_8_sparc64_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC64 %s
+// CHECK-DEBIAN-SPARC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu/crt1.o"
+// CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu/crti.o"
+// CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/crtbegin.o"
+// CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9"
+// CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu"
+// CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/lib/sparc64-linux-gnu"
+// CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/lib/../lib64"
+// CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/sparc64-linux-gnu"
+// CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../.."
+// CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/lib"
+// CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib"
+// CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/crtend.o"
+// CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu/crtn.o"
+//
 // Test linker invocation on Android.
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN:     --target=arm-linux-androideabi \





More information about the cfe-commits mailing list