Home | History | Annotate | Download | only in Driver
      1 // General tests that the header search paths detected by the driver and passed
      2 // to CC1 are sane.
      3 //
      4 // Test a simulated installation of libc++ on Linux, both through sysroot and
      5 // the installation path of Clang.
      6 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
      7 // RUN:     -target x86_64-unknown-linux-gnu \
      8 // RUN:     -stdlib=libc++ \
      9 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
     10 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree \
     11 // RUN:     --gcc-toolchain="" \
     12 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-SYSROOT %s
     13 // CHECK-BASIC-LIBCXX-SYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
     14 // CHECK-BASIC-LIBCXX-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
     15 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"
     16 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
     17 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
     18 // RUN:     -target x86_64-unknown-linux-gnu \
     19 // RUN:     -stdlib=libc++ \
     20 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
     21 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree \
     22 // RUN:     --gcc-toolchain="" \
     23 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-INSTALL %s
     24 // CHECK-BASIC-LIBCXX-INSTALL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
     25 // CHECK-BASIC-LIBCXX-INSTALL: "-isysroot" "[[SYSROOT:[^"]+]]"
     26 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1"
     27 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
     28 //
     29 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
     30 // RUN:     -target x86_64-unknown-linux-gnu \
     31 // RUN:     -stdlib=libc++ \
     32 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
     33 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxxv2_tree \
     34 // RUN:     --gcc-toolchain="" \
     35 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXXV2-SYSROOT %s
     36 // CHECK-BASIC-LIBCXXV2-SYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
     37 // CHECK-BASIC-LIBCXXV2-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
     38 // CHECK-BASIC-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v2"
     39 // CHECK-BASIC-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
     40 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
     41 // RUN:     -target x86_64-unknown-linux-gnu \
     42 // RUN:     -stdlib=libc++ \
     43 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_libcxxv2_tree/usr/bin \
     44 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxxv2_tree \
     45 // RUN:     --gcc-toolchain="" \
     46 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXXV2-INSTALL %s
     47 // CHECK-BASIC-LIBCXXV2-INSTALL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
     48 // CHECK-BASIC-LIBCXXV2-INSTALL: "-isysroot" "[[SYSROOT:[^"]+]]"
     49 // CHECK-BASIC-LIBCXXV2-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v2"
     50 // CHECK-BASIC-LIBCXXV2-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
     51 //
     52 // Test Linux with both libc++ and libstdc++ installed.
     53 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
     54 // RUN:     -target x86_64-unknown-linux-gnu \
     55 // RUN:     -stdlib=libc++ \
     56 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
     57 // RUN:     --sysroot=%S/Inputs/basic_linux_libstdcxx_libcxxv2_tree \
     58 // RUN:     --gcc-toolchain="" \
     59 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT %s
     60 // CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
     61 // CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
     62 // CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v2"
     63 // CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
     64 //
     65 // Test a very broken version of multiarch that shipped in Ubuntu 11.04.
     66 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
     67 // RUN:     -target i386-unknown-linux \
     68 // RUN:     --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
     69 // RUN:     --gcc-toolchain="" \
     70 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
     71 // CHECK-UBUNTU-11-04: "{{.*}}clang{{.*}}" "-cc1"
     72 // CHECK-UBUNTU-11-04: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
     73 // CHECK-UBUNTU-11-04: "-isysroot" "[[SYSROOT:[^"]+]]"
     74 // CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5"
     75 // 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"
     76 // CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/backward"
     77 // CHECK-UBUNTU-11-04: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
     78 // CHECK-UBUNTU-11-04: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
     79 // CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/include"
     80 // CHECK-UBUNTU-11-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
     81 //
     82 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
     83 // RUN:     -target x86_64-unknown-linux-gnu \
     84 // RUN:     --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \
     85 // RUN:     --gcc-toolchain="" \
     86 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-13-04 %s
     87 // CHECK-UBUNTU-13-04: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
     88 // CHECK-UBUNTU-13-04: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
     89 // CHECK-UBUNTU-13-04: "-isysroot" "[[SYSROOT:[^"]+]]"
     90 // CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7"
     91 // CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/c++/4.7"
     92 // CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward"
     93 // CHECK-UBUNTU-13-04: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
     94 // CHECK-UBUNTU-13-04: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
     95 // CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu"
     96 // CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/include"
     97 // CHECK-UBUNTU-13-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
     98 //
     99 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    100 // RUN:     -target x86_64-unknown-linux-gnux32 \
    101 // RUN:     --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
    102 // RUN:     --gcc-toolchain="" \
    103 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-14-04 %s
    104 // CHECK-UBUNTU-14-04: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    105 // CHECK-UBUNTU-14-04: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    106 // CHECK-UBUNTU-14-04: "-isysroot" "[[SYSROOT:[^"]+]]"
    107 // CHECK-UBUNTU-14-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8"
    108 // CHECK-UBUNTU-14-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8/x32"
    109 // CHECK-UBUNTU-14-04: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward"
    110 // CHECK-UBUNTU-14-04: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    111 // CHECK-UBUNTU-14-04: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    112 // CHECK-UBUNTU-14-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu"
    113 // CHECK-UBUNTU-14-04: "-internal-externc-isystem" "[[SYSROOT]]/include"
    114 // CHECK-UBUNTU-14-04: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    115 ///
    116 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    117 // RUN:     -target arm-linux-gnueabihf \
    118 // RUN:     --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \
    119 // RUN:     --gcc-toolchain="" \
    120 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-13-04-CROSS %s
    121 // CHECK-UBUNTU-13-04-CROSS: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    122 // CHECK-UBUNTU-13-04-CROSS: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    123 // CHECK-UBUNTU-13-04-CROSS: "-isysroot" "[[SYSROOT:[^"]+]]"
    124 // CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/c++/4.7"
    125 // CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/arm-linux-gnueabihf/c++/4.7"
    126 // CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.7/../../../../include/c++/4.7/backward"
    127 // CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    128 // CHECK-UBUNTU-13-04-CROSS: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    129 // CHECK-UBUNTU-13-04-CROSS: "-internal-externc-isystem" "[[SYSROOT]]/include"
    130 // CHECK-UBUNTU-13-04-CROSS: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    131 //
    132 // Test Ubuntu/Debian's new version of multiarch, with -m32.
    133 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    134 // RUN:     -target x86_64-unknown-linux-gnu -m32 \
    135 // RUN:     --sysroot=%S/Inputs/ubuntu_13.04_multiarch_tree \
    136 // RUN:     --gcc-toolchain="" \
    137 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-13-04-M32 %s
    138 // CHECK-UBUNTU-13-04-M32: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    139 // CHECK-UBUNTU-13-04-M32: "-triple" "i386-unknown-linux-gnu"
    140 // CHECK-UBUNTU-13-04-M32: "-isysroot" "[[SYSROOT:[^"]+]]"
    141 // CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7"
    142 // CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/x86_64-linux-gnu/c++/4.7/32"
    143 // CHECK-UBUNTU-13-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward"
    144 //
    145 // Test Ubuntu/Debian's Ubuntu 14.04 config variant, with -m32
    146 // and an empty 4.9 directory.
    147 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    148 // RUN:     -target x86_64-unknown-linux-gnu -m32 \
    149 // RUN:     --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
    150 // RUN:     --gcc-toolchain="" \
    151 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-14-04-M32 %s
    152 // CHECK-UBUNTU-14-04-M32: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    153 // CHECK-UBUNTU-14-04-M32: "-triple" "i386-unknown-linux-gnu"
    154 // CHECK-UBUNTU-14-04-M32: "-isysroot" "[[SYSROOT:[^"]+]]"
    155 // CHECK-UBUNTU-14-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8"
    156 // CHECK-UBUNTU-14-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8/32"
    157 // CHECK-UBUNTU-14-04-M32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward"
    158 //
    159 // Test Ubuntu/Debian's Ubuntu 14.04 with -m32 and an i686 cross compiler
    160 // installed rather than relying on multilib. Also happens to look like an
    161 // actual i686 Ubuntu system.
    162 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    163 // RUN:     -target x86_64-unknown-linux-gnu -m32 \
    164 // RUN:     --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree2 \
    165 // RUN:     --gcc-toolchain="" \
    166 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-14-04-I686 %s
    167 // CHECK-UBUNTU-14-04-I686: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    168 // CHECK-UBUNTU-14-04-I686: "-triple" "i386-unknown-linux-gnu"
    169 // CHECK-UBUNTU-14-04-I686: "-isysroot" "[[SYSROOT:[^"]+]]"
    170 // CHECK-UBUNTU-14-04-I686: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.8/../../../../include/c++/4.8"
    171 // CHECK-UBUNTU-14-04-I686: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.8/../../../../include/i386-linux-gnu/c++/4.8"
    172 // CHECK-UBUNTU-14-04-I686: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.8/../../../../include/c++/4.8/backward"
    173 //
    174 // Test Ubuntu/Debian's Ubuntu 14.04 for powerpc64le
    175 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    176 // RUN:     -target powerpc64le-unknown-linux-gnu -m32 \
    177 // RUN:     --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
    178 // RUN:     --gcc-toolchain="" \
    179 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-14-04-PPC64LE %s
    180 // CHECK-UBUNTU-14-04-PPC64LE: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    181 // CHECK-UBUNTU-14-04-PPC64LE: "-triple" "powerpc64le-unknown-linux-gnu"
    182 // CHECK-UBUNTU-14-04-PPC64LE: "-isysroot" "[[SYSROOT:[^"]+]]"
    183 // CHECK-UBUNTU-14-04-PPC64LE: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../../include/c++/4.8"
    184 // CHECK-UBUNTU-14-04-PPC64LE: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../../include/powerpc64le-linux-gnu/c++/4.8"
    185 // CHECK-UBUNTU-14-04-PPC64LE: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../../include/c++/4.8/backward"
    186 // CHECK-UBUNTU-14-04-PPC64LE: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc64le-linux-gnu"
    187 // CHECK-UBUNTU-14-04-PPC64LE: "-internal-externc-isystem" "[[SYSROOT]]/include"
    188 // CHECK-UBUNTU-14-04-PPC64LE: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    189 //
    190 // Thoroughly exercise the Debian multiarch environment.
    191 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    192 // RUN:     -target i686-linux-gnu \
    193 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    194 // RUN:     --gcc-toolchain="" \
    195 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s
    196 // CHECK-DEBIAN-X86: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    197 // CHECK-DEBIAN-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    198 // CHECK-DEBIAN-X86: "-isysroot" "[[SYSROOT:[^"]+]]"
    199 // CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5"
    200 // CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/i686-linux-gnu"
    201 // CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../../include/c++/4.5/backward"
    202 // CHECK-DEBIAN-X86: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    203 // CHECK-DEBIAN-X86: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    204 // CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/i386-linux-gnu"
    205 // CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/include"
    206 // CHECK-DEBIAN-X86: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    207 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    208 // RUN:     -target x86_64-linux-gnu \
    209 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    210 // RUN:     --gcc-toolchain="" \
    211 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s
    212 // CHECK-DEBIAN-X86-64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    213 // CHECK-DEBIAN-X86-64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    214 // CHECK-DEBIAN-X86-64: "-isysroot" "[[SYSROOT:[^"]+]]"
    215 // CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5"
    216 // CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/x86_64-linux-gnu"
    217 // CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../../include/c++/4.5/backward"
    218 // CHECK-DEBIAN-X86-64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    219 // CHECK-DEBIAN-X86-64: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    220 // CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/x86_64-linux-gnu"
    221 // CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/include"
    222 // CHECK-DEBIAN-X86-64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    223 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    224 // RUN:     -target powerpc-linux-gnu \
    225 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    226 // RUN:     --gcc-toolchain="" \
    227 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s
    228 // CHECK-DEBIAN-PPC: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    229 // CHECK-DEBIAN-PPC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    230 // CHECK-DEBIAN-PPC: "-isysroot" "[[SYSROOT:[^"]+]]"
    231 // CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5"
    232 // CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/powerpc-linux-gnu"
    233 // CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../../include/c++/4.5/backward"
    234 // CHECK-DEBIAN-PPC: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    235 // CHECK-DEBIAN-PPC: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    236 // CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc-linux-gnu"
    237 // CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/include"
    238 // CHECK-DEBIAN-PPC: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    239 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    240 // RUN:     -target powerpc64-linux-gnu \
    241 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    242 // RUN:     --gcc-toolchain="" \
    243 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s
    244 // CHECK-DEBIAN-PPC64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    245 // CHECK-DEBIAN-PPC64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    246 // CHECK-DEBIAN-PPC64: "-isysroot" "[[SYSROOT:[^"]+]]"
    247 // CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5"
    248 // CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/powerpc64-linux-gnu"
    249 // CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../../include/c++/4.5/backward"
    250 // CHECK-DEBIAN-PPC64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    251 // CHECK-DEBIAN-PPC64: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    252 // CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/powerpc64-linux-gnu"
    253 // CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/include"
    254 // CHECK-DEBIAN-PPC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    255 //
    256 // Test Gentoo's weirdness both before and after they changed it in their GCC
    257 // 4.6.4 release.
    258 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    259 // RUN:     -target x86_64-unknown-linux-gnu \
    260 // RUN:     --sysroot=%S/Inputs/gentoo_linux_gcc_4.6.2_tree \
    261 // RUN:     --gcc-toolchain="" \
    262 // RUN:   | FileCheck --check-prefix=CHECK-GENTOO-4-6-2 %s
    263 // CHECK-GENTOO-4-6-2: "{{.*}}clang{{.*}}" "-cc1"
    264 // CHECK-GENTOO-4-6-2: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    265 // CHECK-GENTOO-4-6-2: "-isysroot" "[[SYSROOT:[^"]+]]"
    266 // CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4"
    267 // CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/x86_64-pc-linux-gnu"
    268 // CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/backward"
    269 // CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    270 // CHECK-GENTOO-4-6-2: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    271 // CHECK-GENTOO-4-6-2: "-internal-externc-isystem" "[[SYSROOT]]/include"
    272 // CHECK-GENTOO-4-6-2: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    273 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    274 // RUN:     -target x86_64-unknown-linux-gnu \
    275 // RUN:     --sysroot=%S/Inputs/gentoo_linux_gcc_4.6.4_tree \
    276 // RUN:     --gcc-toolchain="" \
    277 // RUN:   | FileCheck --check-prefix=CHECK-GENTOO-4-6-4 %s
    278 // CHECK-GENTOO-4-6-4: "{{.*}}clang{{.*}}" "-cc1"
    279 // CHECK-GENTOO-4-6-4: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    280 // CHECK-GENTOO-4-6-4: "-isysroot" "[[SYSROOT:[^"]+]]"
    281 // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6"
    282 // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6/x86_64-pc-linux-gnu"
    283 // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6/backward"
    284 // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    285 // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    286 // CHECK-GENTOO-4-6-4: "-internal-externc-isystem" "[[SYSROOT]]/include"
    287 // CHECK-GENTOO-4-6-4: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    288 //
    289 // Check header search on Debian 6 / MIPS64
    290 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    291 // RUN:     -target mips64-unknown-linux-gnuabi64 \
    292 // RUN:     --sysroot=%S/Inputs/debian_6_mips64_tree \
    293 // RUN:     --gcc-toolchain="" \
    294 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64-GNUABI %s
    295 // CHECK-MIPS64-GNUABI: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    296 // CHECK-MIPS64-GNUABI: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    297 // CHECK-MIPS64-GNUABI: "-isysroot" "[[SYSROOT:[^"]+]]"
    298 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../../include/c++/4.9"
    299 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../../include/c++/4.9/mips64-linux-gnuabi64"
    300 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../../include/c++/4.9/backward"
    301 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    302 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    303 // CHECK-MIPS64-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/mips64-linux-gnuabi64"
    304 // CHECK-MIPS64-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/include"
    305 // CHECK-MIPS64-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    306 //
    307 // Check header search on Debian 6 / MIPS64
    308 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    309 // RUN:     -target mips64el-unknown-linux-gnuabi64 \
    310 // RUN:     --sysroot=%S/Inputs/debian_6_mips64_tree \
    311 // RUN:     --gcc-toolchain="" \
    312 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABI %s
    313 // CHECK-MIPS64EL-GNUABI: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    314 // CHECK-MIPS64EL-GNUABI: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    315 // CHECK-MIPS64EL-GNUABI: "-isysroot" "[[SYSROOT:[^"]+]]"
    316 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../include/c++/4.9"
    317 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../include/c++/4.9/mips64el-linux-gnuabi64"
    318 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../include/c++/4.9/backward"
    319 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    320 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    321 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/mips64el-linux-gnuabi64"
    322 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/include"
    323 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    324 
    325 // Check header search on Debian 8 / Sparc
    326 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    327 // RUN:     -target sparc-unknown-linux-gnu \
    328 // RUN:     --sysroot=%S/Inputs/debian_8_sparc_multilib_tree \
    329 // RUN:     --gcc-toolchain="" \
    330 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC32 %s
    331 // CHECK-DEBIAN-SPARC32: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    332 // CHECK-DEBIAN-SPARC32: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    333 // CHECK-DEBIAN-SPARC32: "-isysroot" "[[SYSROOT:[^"]+]]"
    334 // CHECK-DEBIAN-SPARC32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/c++/4.9"
    335 // CHECK-DEBIAN-SPARC32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/sparc-linux-gnu/c++/4.9"
    336 // CHECK-DEBIAN-SPARC32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/c++/4.9/backward"
    337 // CHECK-DEBIAN-SPARC32: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    338 // CHECK-DEBIAN-SPARC32: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    339 // CHECK-DEBIAN-SPARC32: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/sparc-linux-gnu"
    340 // CHECK-DEBIAN-SPARC32: "-internal-externc-isystem" "[[SYSROOT]]/include"
    341 // CHECK-DEBIAN-SPARC32: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    342 
    343 // Check header search on Debian 8 / Sparc, with the oldstyle multilib packages
    344 // RUN: %clang -no-canonical-prefixes -m64 %s -### -fsyntax-only 2>&1 \
    345 // RUN:     -target sparc-unknown-linux-gnu \
    346 // RUN:     --sysroot=%S/Inputs/debian_8_sparc_multilib_tree \
    347 // RUN:     --gcc-toolchain="" \
    348 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC32-LIB64 %s
    349 // CHECK-DEBIAN-SPARC32-LIB64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    350 // CHECK-DEBIAN-SPARC32-LIB64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    351 // CHECK-DEBIAN-SPARC32-LIB64: "-isysroot" "[[SYSROOT:[^"]+]]"
    352 // CHECK-DEBIAN-SPARC32-LIB64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/c++/4.9"
    353 // CHECK-DEBIAN-SPARC32-LIB64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/sparc-linux-gnu/c++/4.9/64"
    354 // CHECK-DEBIAN-SPARC32-LIB64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../include/c++/4.9/backward"
    355 // CHECK-DEBIAN-SPARC32-LIB64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    356 // CHECK-DEBIAN-SPARC32-LIB64: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    357 /* TODO: GCC 4.9 includes the following dir in its search path, which
    358    seems questionable. Clang doesn't. Not sure if clang should be
    359    doing that too. */
    360 // CHECK-DEBIAN-SPARC32-LIB64-todo: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/sparc-linux-gnu"
    361 // CHECK-DEBIAN-SPARC32-LIB64: "-internal-externc-isystem" "[[SYSROOT]]/include"
    362 // CHECK-DEBIAN-SPARC32-LIB64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    363 
    364 // Check header search on Debian 8 / Sparc64
    365 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
    366 // RUN:     -target sparc64-unknown-linux-gnu \
    367 // RUN:     --sysroot=%S/Inputs/debian_8_sparc64_tree \
    368 // RUN:     --gcc-toolchain="" \
    369 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC64 %s
    370 // CHECK-DEBIAN-SPARC64: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    371 // CHECK-DEBIAN-SPARC64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
    372 // CHECK-DEBIAN-SPARC64: "-isysroot" "[[SYSROOT:[^"]+]]"
    373 // CHECK-DEBIAN-SPARC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../../include/c++/4.9"
    374 // CHECK-DEBIAN-SPARC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../../include/sparc64-linux-gnu/c++/4.9"
    375 // CHECK-DEBIAN-SPARC64: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../../include/c++/4.9/backward"
    376 // CHECK-DEBIAN-SPARC64: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    377 // CHECK-DEBIAN-SPARC64: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
    378 // CHECK-DEBIAN-SPARC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/sparc64-linux-gnu"
    379 // CHECK-DEBIAN-SPARC64: "-internal-externc-isystem" "[[SYSROOT]]/include"
    380 // CHECK-DEBIAN-SPARC64: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
    381