Home | History | Annotate | Download | only in Driver
      1 // General tests that ld invocations on Linux targets sane. Note that we use
      2 // sysroot to make these tests independent of the host system.
      3 //
      4 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
      5 // RUN:     --target=i386-unknown-linux \
      6 // RUN:     --gcc-toolchain="" \
      7 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
      8 // RUN:   | FileCheck --check-prefix=CHECK-LD-32 %s
      9 // CHECK-LD-32-NOT: warning:
     10 // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
     11 // CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
     12 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
     13 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
     14 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
     15 // CHECK-LD-32: "-L[[SYSROOT]]/lib"
     16 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib"
     17 //
     18 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
     19 // RUN:     --target=x86_64-unknown-linux \
     20 // RUN:     --gcc-toolchain="" \
     21 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
     22 // RUN:   | FileCheck --check-prefix=CHECK-LD-64 %s
     23 // CHECK-LD-64-NOT: warning:
     24 // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
     25 // CHECK-LD-64: "--eh-frame-hdr"
     26 // CHECK-LD-64: "-m" "elf_x86_64"
     27 // CHECK-LD-64: "-dynamic-linker"
     28 // CHECK-LD-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
     29 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
     30 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
     31 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
     32 // CHECK-LD-64: "-L[[SYSROOT]]/lib"
     33 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib"
     34 // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
     35 // CHECK-LD-64: "-lc"
     36 // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
     37 //
     38 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
     39 // RUN:     --target=x86_64-unknown-linux-gnux32 \
     40 // RUN:     --gcc-toolchain="" \
     41 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
     42 // RUN:   | FileCheck --check-prefix=CHECK-LD-X32 %s
     43 // CHECK-LD-X32-NOT: warning:
     44 // CHECK-LD-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
     45 // CHECK-LD-X32: "--eh-frame-hdr"
     46 // CHECK-LD-X32: "-m" "elf32_x86_64"
     47 // CHECK-LD-X32: "-dynamic-linker"
     48 // CHECK-LD-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
     49 // CHECK-LD-X32: "-lc"
     50 // CHECK-LD-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
     51 //
     52 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
     53 // RUN:     --target=x86_64-unknown-linux \
     54 // RUN:     --gcc-toolchain="" \
     55 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
     56 // RUN:     --rtlib=compiler-rt \
     57 // RUN:   | FileCheck --check-prefix=CHECK-LD-RT %s
     58 // CHECK-LD-RT-NOT: warning:
     59 // CHECK-LD-RT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
     60 // CHECK-LD-RT: "--eh-frame-hdr"
     61 // CHECK-LD-RT: "-m" "elf_x86_64"
     62 // CHECK-LD-RT: "-dynamic-linker"
     63 // CHECK-LD-RT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
     64 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
     65 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
     66 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
     67 // CHECK-LD-RT: "-L[[SYSROOT]]/lib"
     68 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib"
     69 // CHECK-LD-RT: libclang_rt.builtins-x86_64.a"
     70 // CHECK-LD-RT: "-lc"
     71 // CHECK-LD-RT: libclang_rt.builtins-x86_64.a"
     72 //
     73 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
     74 // RUN:     --target=arm-linux-androideabi \
     75 // RUN:     --gcc-toolchain="" \
     76 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
     77 // RUN:     --rtlib=compiler-rt \
     78 // RUN:   | FileCheck --check-prefix=CHECK-LD-RT-ANDROID %s
     79 // CHECK-LD-RT-ANDROID-NOT: warning:
     80 // CHECK-LD-RT-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
     81 // CHECK-LD-RT-ANDROID: "--eh-frame-hdr"
     82 // CHECK-LD-RT-ANDROID: "-m" "armelf_linux_eabi"
     83 // CHECK-LD-RT-ANDROID: "-dynamic-linker"
     84 // CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a"
     85 // CHECK-LD-RT-ANDROID: "-lc"
     86 // CHECK-LD-RT-ANDROID: libclang_rt.builtins-arm-android.a"
     87 //
     88 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
     89 // RUN:     --target=x86_64-unknown-linux \
     90 // RUN:     --gcc-toolchain="" \
     91 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
     92 // RUN:     --rtlib=libgcc \
     93 // RUN:   | FileCheck --check-prefix=CHECK-LD-GCC %s
     94 // CHECK-LD-GCC-NOT: warning:
     95 // CHECK-LD-GCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
     96 // CHECK-LD-GCC: "--eh-frame-hdr"
     97 // CHECK-LD-GCC: "-m" "elf_x86_64"
     98 // CHECK-LD-GCC: "-dynamic-linker"
     99 // CHECK-LD-GCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
    100 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    101 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
    102 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
    103 // CHECK-LD-GCC: "-L[[SYSROOT]]/lib"
    104 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib"
    105 // CHECK-LD-GCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
    106 // CHECK-LD-GCC: "-lc"
    107 // CHECK-LD-GCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
    108 //
    109 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    110 // RUN:     --target=x86_64-unknown-linux \
    111 // RUN:     -static-libgcc \
    112 // RUN:     --gcc-toolchain="" \
    113 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
    114 // RUN:   | FileCheck --check-prefix=CHECK-LD-64-STATIC-LIBGCC %s
    115 // CHECK-LD-64-STATIC-LIBGCC-NOT: warning:
    116 // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    117 // CHECK-LD-64-STATIC-LIBGCC: "--eh-frame-hdr"
    118 // CHECK-LD-64-STATIC-LIBGCC: "-m" "elf_x86_64"
    119 // CHECK-LD-64-STATIC-LIBGCC: "-dynamic-linker"
    120 // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
    121 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    122 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
    123 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
    124 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/lib"
    125 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib"
    126 // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
    127 // CHECK-LD-64-STATIC-LIBGCC: "-lc"
    128 // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
    129 //
    130 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    131 // RUN:     --target=x86_64-unknown-linux \
    132 // RUN:     -static \
    133 // RUN:     --gcc-toolchain="" \
    134 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
    135 // RUN:   | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
    136 // CHECK-LD-64-STATIC-NOT: warning:
    137 // CHECK-LD-64-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    138 // CHECK-LD-64-STATIC-NOT: "--eh-frame-hdr"
    139 // CHECK-LD-64-STATIC: "-m" "elf_x86_64"
    140 // CHECK-LD-64-STATIC-NOT: "-dynamic-linker"
    141 // CHECK-LD-64-STATIC: "-static"
    142 // CHECK-LD-64-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbeginT.o"
    143 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    144 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
    145 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
    146 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/lib"
    147 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib"
    148 // CHECK-LD-64-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
    149 //
    150 // Check that flags can be combined. The -static dominates.
    151 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    152 // RUN:     --target=x86_64-unknown-linux \
    153 // RUN:     -static-libgcc -static \
    154 // RUN:     --gcc-toolchain="" \
    155 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
    156 // RUN:   | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
    157 //
    158 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    159 // RUN:     --target=i386-unknown-linux -m32 \
    160 // RUN:     --gcc-toolchain="" \
    161 // RUN:     --sysroot=%S/Inputs/multilib_32bit_linux_tree \
    162 // RUN:   | FileCheck --check-prefix=CHECK-32-TO-32 %s
    163 // CHECK-32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    164 // CHECK-32-TO-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
    165 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
    166 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib32"
    167 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib32"
    168 // CHECK-32-TO-32: "-L[[SYSROOT]]/lib/../lib32"
    169 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32"
    170 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
    171 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
    172 // CHECK-32-TO-32: "-L[[SYSROOT]]/lib"
    173 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib"
    174 //
    175 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    176 // RUN:     --target=i386-unknown-linux -m64 \
    177 // RUN:     --gcc-toolchain="" \
    178 // RUN:     --sysroot=%S/Inputs/multilib_32bit_linux_tree \
    179 // RUN:   | FileCheck --check-prefix=CHECK-32-TO-64 %s
    180 // CHECK-32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    181 // CHECK-32-TO-64: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/64{{/|\\\\}}crtbegin.o"
    182 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/64"
    183 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib64"
    184 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib64"
    185 // CHECK-32-TO-64: "-L[[SYSROOT]]/lib/../lib64"
    186 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
    187 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
    188 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
    189 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
    190 // CHECK-32-TO-64: "-L[[SYSROOT]]/lib"
    191 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib"
    192 //
    193 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    194 // RUN:     --target=x86_64-unknown-linux -m64 \
    195 // RUN:     --gcc-toolchain="" \
    196 // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
    197 // RUN:   | FileCheck --check-prefix=CHECK-64-TO-64 %s
    198 // CHECK-64-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    199 // CHECK-64-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
    200 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    201 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib64"
    202 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib64"
    203 // CHECK-64-TO-64: "-L[[SYSROOT]]/lib/../lib64"
    204 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
    205 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
    206 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
    207 // CHECK-64-TO-64: "-L[[SYSROOT]]/lib"
    208 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib"
    209 //
    210 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    211 // RUN:     --target=x86_64-unknown-linux -m32 \
    212 // RUN:     --gcc-toolchain="" \
    213 // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
    214 // RUN:   | FileCheck --check-prefix=CHECK-64-TO-32 %s
    215 // CHECK-64-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    216 // CHECK-64-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o"
    217 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32"
    218 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib32"
    219 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib32"
    220 // CHECK-64-TO-32: "-L[[SYSROOT]]/lib/../lib32"
    221 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32"
    222 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    223 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
    224 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
    225 // CHECK-64-TO-32: "-L[[SYSROOT]]/lib"
    226 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib"
    227 //
    228 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    229 // RUN:     --target=x86_64-unknown-linux-gnux32 \
    230 // RUN:     --gcc-toolchain="" \
    231 // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
    232 // RUN:   | FileCheck --check-prefix=CHECK-X32 %s
    233 // CHECK-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    234 // CHECK-X32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32{{/|\\\\}}crtbegin.o"
    235 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32"
    236 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../libx32"
    237 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../libx32"
    238 // CHECK-X32: "-L[[SYSROOT]]/lib/../libx32"
    239 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
    240 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    241 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
    242 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
    243 // CHECK-X32: "-L[[SYSROOT]]/lib"
    244 // CHECK-X32: "-L[[SYSROOT]]/usr/lib"
    245 //
    246 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    247 // RUN:     --target=x86_64-unknown-linux -mx32 \
    248 // RUN:     --gcc-toolchain="" \
    249 // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
    250 // RUN:   | FileCheck --check-prefix=CHECK-64-TO-X32 %s
    251 // CHECK-64-TO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    252 // CHECK-64-TO-X32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32{{/|\\\\}}crtbegin.o"
    253 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32"
    254 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../libx32"
    255 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../libx32"
    256 // CHECK-64-TO-X32: "-L[[SYSROOT]]/lib/../libx32"
    257 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
    258 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    259 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
    260 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
    261 // CHECK-64-TO-X32: "-L[[SYSROOT]]/lib"
    262 // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib"
    263 //
    264 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    265 // RUN:     --target=i386-unknown-linux -mx32 \
    266 // RUN:     --gcc-toolchain="" \
    267 // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
    268 // RUN:   | FileCheck --check-prefix=CHECK-32-TO-X32 %s
    269 // CHECK-32-TO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    270 // CHECK-32-TO-X32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32{{/|\\\\}}crtbegin.o"
    271 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32"
    272 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../libx32"
    273 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../libx32"
    274 // CHECK-32-TO-X32: "-L[[SYSROOT]]/lib/../libx32"
    275 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
    276 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    277 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
    278 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
    279 // CHECK-32-TO-X32: "-L[[SYSROOT]]/lib"
    280 // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib"
    281 //
    282 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    283 // RUN:     --target=x86_64-unknown-linux-gnux32 -m64 \
    284 // RUN:     --gcc-toolchain="" \
    285 // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
    286 // RUN:   | FileCheck --check-prefix=CHECK-X32-TO-64 %s
    287 // CHECK-X32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    288 // CHECK-X32-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
    289 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    290 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib64"
    291 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib64"
    292 // CHECK-X32-TO-64: "-L[[SYSROOT]]/lib/../lib64"
    293 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
    294 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
    295 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
    296 // CHECK-X32-TO-64: "-L[[SYSROOT]]/lib"
    297 // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib"
    298 //
    299 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    300 // RUN:     --target=x86_64-unknown-linux-gnux32 -m32 \
    301 // RUN:     --gcc-toolchain="" \
    302 // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
    303 // RUN:   | FileCheck --check-prefix=CHECK-X32-TO-32 %s
    304 // CHECK-X32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    305 // CHECK-X32-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o"
    306 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32"
    307 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib32"
    308 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib32"
    309 // CHECK-X32-TO-32: "-L[[SYSROOT]]/lib/../lib32"
    310 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32"
    311 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    312 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
    313 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
    314 // CHECK-X32-TO-32: "-L[[SYSROOT]]/lib"
    315 // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib"
    316 //
    317 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    318 // RUN:     --target=x86_64-unknown-linux -m32 \
    319 // RUN:     --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \
    320 // RUN:     --sysroot=%S/Inputs/multilib_32bit_linux_tree \
    321 // RUN:   | FileCheck --check-prefix=CHECK-64-TO-32-SYSROOT %s
    322 // CHECK-64-TO-32-SYSROOT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    323 // CHECK-64-TO-32-SYSROOT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o"
    324 // CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32"
    325 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib/../lib32"
    326 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib/../lib32"
    327 // CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    328 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib"
    329 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib"
    330 //
    331 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    332 // RUN:     --target=i386-unknown-linux -m32 \
    333 // RUN:     -ccc-install-dir %S/Inputs/fake_install_tree/bin \
    334 // RUN:     --gcc-toolchain="" \
    335 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
    336 // RUN:   | FileCheck --check-prefix=CHECK-INSTALL-DIR-32 %s
    337 // CHECK-INSTALL-DIR-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    338 // CHECK-INSTALL-DIR-32: "{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0{{/|\\\\}}crtbegin.o"
    339 // CHECK-INSTALL-DIR-32: "-L{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0"
    340 //
    341 // Check that with 64-bit builds, we don't actually use the install directory
    342 // as its version of GCC is lower than our sysrooted version.
    343 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    344 // RUN:     --target=x86_64-unknown-linux -m64 \
    345 // RUN:     -ccc-install-dir %S/Inputs/fake_install_tree/bin \
    346 // RUN:     --gcc-toolchain="" \
    347 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
    348 // RUN:   | FileCheck --check-prefix=CHECK-INSTALL-DIR-64 %s
    349 // CHECK-INSTALL-DIR-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    350 // CHECK-INSTALL-DIR-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
    351 // CHECK-INSTALL-DIR-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
    352 //
    353 // Check that we support unusual patch version formats, including missing that
    354 // component.
    355 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    356 // RUN:     --target=i386-unknown-linux -m32 \
    357 // RUN:     -ccc-install-dir %S/Inputs/gcc_version_parsing1/bin \
    358 // RUN:     --gcc-toolchain="" \
    359 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
    360 // RUN:   | FileCheck --check-prefix=CHECK-GCC-VERSION1 %s
    361 // CHECK-GCC-VERSION1: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    362 // CHECK-GCC-VERSION1: "{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7{{/|\\\\}}crtbegin.o"
    363 // CHECK-GCC-VERSION1: "-L{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7"
    364 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    365 // RUN:     --target=i386-unknown-linux -m32 \
    366 // RUN:     -ccc-install-dir %S/Inputs/gcc_version_parsing2/bin \
    367 // RUN:     --gcc-toolchain="" \
    368 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
    369 // RUN:   | FileCheck --check-prefix=CHECK-GCC-VERSION2 %s
    370 // CHECK-GCC-VERSION2: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    371 // CHECK-GCC-VERSION2: "{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x{{/|\\\\}}crtbegin.o"
    372 // CHECK-GCC-VERSION2: "-L{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x"
    373 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    374 // RUN:     --target=i386-unknown-linux -m32 \
    375 // RUN:     -ccc-install-dir %S/Inputs/gcc_version_parsing3/bin \
    376 // RUN:     --gcc-toolchain="" \
    377 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
    378 // RUN:   | FileCheck --check-prefix=CHECK-GCC-VERSION3 %s
    379 // CHECK-GCC-VERSION3: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    380 // CHECK-GCC-VERSION3: "{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5{{/|\\\\}}crtbegin.o"
    381 // CHECK-GCC-VERSION3: "-L{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5"
    382 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    383 // RUN:     --target=i386-unknown-linux -m32 \
    384 // RUN:     -ccc-install-dir %S/Inputs/gcc_version_parsing4/bin \
    385 // RUN:     --gcc-toolchain="" \
    386 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
    387 // RUN:   | FileCheck --check-prefix=CHECK-GCC-VERSION4 %s
    388 // CHECK-GCC-VERSION4: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    389 // CHECK-GCC-VERSION4: "{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99{{/|\\\\}}crtbegin.o"
    390 // CHECK-GCC-VERSION4: "-L{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99"
    391 //
    392 // Test a simulated installation of libc++ on Linux, both through sysroot and
    393 // the installation path of Clang.
    394 // RUN: %clangxx -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \
    395 // RUN:     -target x86_64-unknown-linux-gnu \
    396 // RUN:     -stdlib=libc++ \
    397 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
    398 // RUN:     --gcc-toolchain="" \
    399 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree \
    400 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-SYSROOT %s
    401 // CHECK-BASIC-LIBCXX-SYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    402 // CHECK-BASIC-LIBCXX-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
    403 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"
    404 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    405 // CHECK-BASIC-LIBCXX-SYSROOT: "--sysroot=[[SYSROOT]]"
    406 // RUN: %clang -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \
    407 // RUN:     -target x86_64-unknown-linux-gnu \
    408 // RUN:     -stdlib=libc++ \
    409 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
    410 // RUN:     --gcc-toolchain="" \
    411 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree \
    412 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-INSTALL %s
    413 // CHECK-BASIC-LIBCXX-INSTALL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    414 // CHECK-BASIC-LIBCXX-INSTALL: "-isysroot" "[[SYSROOT:[^"]+]]"
    415 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1"
    416 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    417 // CHECK-BASIC-LIBCXX-INSTALL: "--sysroot=[[SYSROOT]]"
    418 // CHECK-BASIC-LIBCXX-INSTALL: "-L[[SYSROOT]]/usr/bin/../lib"
    419 //
    420 // Test that we can use -stdlib=libc++ in a build system even when it
    421 // occasionally links C code instead of C++ code.
    422 // RUN: %clang -no-canonical-prefixes -x c %s -### -o %t.o 2>&1 \
    423 // RUN:     -target x86_64-unknown-linux-gnu \
    424 // RUN:     -stdlib=libc++ \
    425 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
    426 // RUN:     --gcc-toolchain="" \
    427 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree \
    428 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-C-LINK %s
    429 // CHECK-BASIC-LIBCXX-C-LINK-NOT: warning:
    430 // CHECK-BASIC-LIBCXX-C-LINK: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    431 // CHECK-BASIC-LIBCXX-C-LINK: "-isysroot" "[[SYSROOT:[^"]+]]"
    432 // CHECK-BASIC-LIBCXX-C-LINK-NOT: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1"
    433 // CHECK-BASIC-LIBCXX-C-LINK: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    434 // CHECK-BASIC-LIBCXX-C-LINK: "--sysroot=[[SYSROOT]]"
    435 // CHECK-BASIC-LIBCXX-C-LINK: "-L[[SYSROOT]]/usr/bin/../lib"
    436 //
    437 // Test a very broken version of multiarch that shipped in Ubuntu 11.04.
    438 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    439 // RUN:     --target=i386-unknown-linux \
    440 // RUN:     --gcc-toolchain="" \
    441 // RUN:     --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
    442 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
    443 // CHECK-UBUNTU-11-04: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    444 // CHECK-UBUNTU-11-04: "{{.*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    445 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5"
    446 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../i386-linux-gnu"
    447 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu"
    448 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.."
    449 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/lib"
    450 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib"
    451 //
    452 // Check multi arch support on Ubuntu 12.04 LTS.
    453 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    454 // RUN:     --target=arm-unknown-linux-gnueabihf \
    455 // RUN:     --gcc-toolchain="" \
    456 // RUN:     --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
    457 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM-HF %s
    458 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    459 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crt1.o"
    460 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crti.o"
    461 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtbegin.o"
    462 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3"
    463 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf"
    464 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/lib/arm-linux-gnueabihf"
    465 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabihf"
    466 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../.."
    467 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtend.o"
    468 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crtn.o"
    469 //
    470 // Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabihf.
    471 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    472 // RUN:     --target=arm-linux-gnueabihf \
    473 // RUN:     --gcc-toolchain="" \
    474 // RUN:     --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
    475 // RUN:   | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM-HF %s
    476 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    477 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-dynamic-linker" "/lib/ld-linux-armhf.so.3"
    478 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crt1.o"
    479 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crti.o"
    480 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtbegin.o"
    481 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8"
    482 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib"
    483 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/lib/../lib"
    484 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/../lib"
    485 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib"
    486 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtend.o"
    487 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crtn.o"
    488 //
    489 // Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabi.
    490 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    491 // RUN:     --target=arm-linux-gnueabi \
    492 // RUN:     --gcc-toolchain="" \
    493 // RUN:     --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
    494 // RUN:   | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM %s
    495 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    496 // CHECK-X86-64-UBUNTU-13-10-ARM: "-dynamic-linker" "/lib/ld-linux.so.3"
    497 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crt1.o"
    498 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crti.o"
    499 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtbegin.o"
    500 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7"
    501 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib"
    502 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/lib/../lib"
    503 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/../lib"
    504 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib"
    505 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtend.o"
    506 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crtn.o"
    507 //
    508 // Check Ubuntu 14.04 on powerpc64le.
    509 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    510 // RUN:     --target=powerpc64le-unknown-linux-gnu \
    511 // RUN:     --gcc-toolchain="" \
    512 // RUN:     --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
    513 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-14-04-PPC64LE %s
    514 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    515 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crt1.o"
    516 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crti.o"
    517 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8{{/|\\\\}}crtbegin.o"
    518 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8"
    519 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu"
    520 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/lib/powerpc64le-linux-gnu"
    521 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/powerpc64le-linux-gnu"
    522 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../.."
    523 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8{{/|\\\\}}crtend.o"
    524 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crtn.o"
    525 //
    526 // Check Ubuntu 14.04 on x32.
    527 // "/usr/lib/gcc/x86_64-linux-gnu/4.8/x32/crtend.o" "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32/crtn.o"
    528 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    529 // RUN:     --target=x86_64-unknown-linux-gnux32 \
    530 // RUN:     --gcc-toolchain="" \
    531 // RUN:     --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
    532 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-14-04-X32 %s
    533 // CHECK-UBUNTU-14-04-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    534 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crt1.o"
    535 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crti.o"
    536 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/x32{{/|\\\\}}crtbegin.o"
    537 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/x32"
    538 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32"
    539 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/lib/../libx32"
    540 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
    541 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu/../../libx32"
    542 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8"
    543 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.."
    544 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/x32{{/|\\\\}}crtend.o"
    545 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crtn.o"
    546 //
    547 // Check fedora 18 on arm.
    548 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    549 // RUN:     --target=armv7-unknown-linux-gnueabihf \
    550 // RUN:     --gcc-toolchain="" \
    551 // RUN:     --sysroot=%S/Inputs/fedora_18_tree \
    552 // RUN:   | FileCheck --check-prefix=CHECK-FEDORA-18-ARM-HF %s
    553 // CHECK-FEDORA-18-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    554 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crt1.o"
    555 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crti.o"
    556 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtbegin.o"
    557 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2"
    558 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib"
    559 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtend.o"
    560 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crtn.o"
    561 //
    562 // Check Fedora 21 on AArch64.
    563 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    564 // RUN:     --target=arm64-unknown-linux-gnu \
    565 // RUN:     --gcc-toolchain="" \
    566 // RUN:     --sysroot=%S/Inputs/fedora_21_tree \
    567 // RUN:   | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s
    568 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    569 // RUN:     --target=aarch64-unknown-linux-gnu \
    570 // RUN:     --gcc-toolchain="" \
    571 // RUN:     --sysroot=%S/Inputs/fedora_21_tree \
    572 // RUN:   | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s
    573 // CHECK-FEDORA-21-AARCH64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    574 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crt1.o"
    575 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crti.o"
    576 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|\\\\}}crtbegin.o"
    577 // CHECK-FEDORA-21-AARCH64: "-L[[SYSROOT]]/usr/lib/gcc/aarch64-redhat-linux/4.9.0"
    578 // CHECK-FEDORA-21-AARCH64: "-L[[SYSROOT]]/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64"
    579 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|\\\\}}crtend.o"
    580 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crtn.o"
    581 //
    582 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    583 // RUN:     --target=arm-unknown-linux-gnueabi \
    584 // RUN:     --gcc-toolchain="" \
    585 // RUN:     --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
    586 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM %s
    587 // CHECK-UBUNTU-12-04-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    588 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crt1.o"
    589 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crti.o"
    590 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtbegin.o"
    591 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1"
    592 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi"
    593 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/lib/arm-linux-gnueabi"
    594 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabi"
    595 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../.."
    596 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtend.o"
    597 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crtn.o"
    598 //
    599 // Test the setup that shipped in SUSE 10.3 on ppc64.
    600 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    601 // RUN:     --target=powerpc64-suse-linux \
    602 // RUN:     --gcc-toolchain="" \
    603 // RUN:     --sysroot=%S/Inputs/suse_10.3_ppc64_tree \
    604 // RUN:   | FileCheck --check-prefix=CHECK-SUSE-10-3-PPC64 %s
    605 // CHECK-SUSE-10-3-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    606 // CHECK-SUSE-10-3-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64{{/|\\\\}}crtbegin.o"
    607 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64"
    608 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib64"
    609 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/lib/../lib64"
    610 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/../lib64"
    611 //
    612 // Check dynamic-linker for different archs
    613 // RUN: %clang %s -### -o %t.o 2>&1 \
    614 // RUN:     --target=arm-linux-gnueabi \
    615 // RUN:   | FileCheck --check-prefix=CHECK-ARM %s
    616 // CHECK-ARM: "{{.*}}ld{{(.exe)?}}"
    617 // CHECK-ARM: "-m" "armelf_linux_eabi"
    618 // CHECK-ARM: "-dynamic-linker" "{{.*}}/lib/ld-linux.so.3"
    619 //
    620 // RUN: %clang %s -### -o %t.o 2>&1 \
    621 // RUN:     --target=arm-linux-gnueabi -mfloat-abi=hard \
    622 // RUN:   | FileCheck --check-prefix=CHECK-ARM-ABIHF %s
    623 // CHECK-ARM-ABIHF: "{{.*}}ld{{(.exe)?}}"
    624 // CHECK-ARM-ABIHF: "-m" "armelf_linux_eabi"
    625 // CHECK-ARM-ABIHF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3"
    626 //
    627 // RUN: %clang %s -### -o %t.o 2>&1 \
    628 // RUN:     --target=arm-linux-gnueabihf \
    629 // RUN:   | FileCheck --check-prefix=CHECK-ARM-HF %s
    630 // CHECK-ARM-HF: "{{.*}}ld{{(.exe)?}}"
    631 // CHECK-ARM-HF: "-m" "armelf_linux_eabi"
    632 // CHECK-ARM-HF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3"
    633 //
    634 // RUN: %clang %s -### -o %t.o 2>&1 \
    635 // RUN:     --target=powerpc64-linux-gnu \
    636 // RUN:   | FileCheck --check-prefix=CHECK-PPC64 %s
    637 // CHECK-PPC64: "{{.*}}ld{{(.exe)?}}"
    638 // CHECK-PPC64: "-m" "elf64ppc"
    639 // CHECK-PPC64: "-dynamic-linker" "{{.*}}/lib64/ld64.so.1"
    640 //
    641 // RUN: %clang %s -### -o %t.o 2>&1 \
    642 // RUN:     --target=powerpc64-linux-gnu -mabi=elfv1 \
    643 // RUN:   | FileCheck --check-prefix=CHECK-PPC64-ELFv1 %s
    644 // RUN: %clang %s -### -o %t.o 2>&1 \
    645 // RUN:     --target=powerpc64-linux-gnu -mabi=elfv1-qpx \
    646 // RUN:   | FileCheck --check-prefix=CHECK-PPC64-ELFv1 %s
    647 // CHECK-PPC64-ELFv1: "{{.*}}ld{{(.exe)?}}"
    648 // CHECK-PPC64-ELFv1: "-m" "elf64ppc"
    649 // CHECK-PPC64-ELFv1: "-dynamic-linker" "{{.*}}/lib64/ld64.so.1"
    650 //
    651 // RUN: %clang %s -### -o %t.o 2>&1 \
    652 // RUN:     --target=powerpc64-linux-gnu -mabi=elfv2 \
    653 // RUN:   | FileCheck --check-prefix=CHECK-PPC64-ELFv2 %s
    654 // CHECK-PPC64-ELFv2: "{{.*}}ld{{(.exe)?}}"
    655 // CHECK-PPC64-ELFv2: "-m" "elf64ppc"
    656 // CHECK-PPC64-ELFv2: "-dynamic-linker" "{{.*}}/lib64/ld64.so.2"
    657 //
    658 // RUN: %clang %s -### -o %t.o 2>&1 \
    659 // RUN:     --target=powerpc64le-linux-gnu \
    660 // RUN:   | FileCheck --check-prefix=CHECK-PPC64LE %s
    661 // CHECK-PPC64LE: "{{.*}}ld{{(.exe)?}}"
    662 // CHECK-PPC64LE: "-m" "elf64lppc"
    663 // CHECK-PPC64LE: "-dynamic-linker" "{{.*}}/lib64/ld64.so.2"
    664 //
    665 // RUN: %clang %s -### -o %t.o 2>&1 \
    666 // RUN:     --target=powerpc64le-linux-gnu -mabi=elfv1 \
    667 // RUN:   | FileCheck --check-prefix=CHECK-PPC64LE-ELFv1 %s
    668 // CHECK-PPC64LE-ELFv1: "{{.*}}ld{{(.exe)?}}"
    669 // CHECK-PPC64LE-ELFv1: "-m" "elf64lppc"
    670 // CHECK-PPC64LE-ELFv1: "-dynamic-linker" "{{.*}}/lib64/ld64.so.1"
    671 //
    672 // RUN: %clang %s -### -o %t.o 2>&1 \
    673 // RUN:     --target=powerpc64le-linux-gnu -mabi=elfv2 \
    674 // RUN:   | FileCheck --check-prefix=CHECK-PPC64LE-ELFv2 %s
    675 // CHECK-PPC64LE-ELFv2: "{{.*}}ld{{(.exe)?}}"
    676 // CHECK-PPC64LE-ELFv2: "-m" "elf64lppc"
    677 // CHECK-PPC64LE-ELFv2: "-dynamic-linker" "{{.*}}/lib64/ld64.so.2"
    678 //
    679 // Check that we do not pass --hash-style=gnu and --hash-style=both to linker
    680 // and provide correct path to the dynamic linker and emulation mode when build
    681 // for MIPS platforms.
    682 // RUN: %clang %s -### -o %t.o 2>&1 \
    683 // RUN:     --target=mips-linux-gnu \
    684 // RUN:   | FileCheck --check-prefix=CHECK-MIPS %s
    685 // CHECK-MIPS: "{{.*}}ld{{(.exe)?}}"
    686 // CHECK-MIPS: "-m" "elf32btsmip"
    687 // CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1"
    688 // CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
    689 //
    690 // RUN: %clang %s -### -o %t.o 2>&1 \
    691 // RUN:     --target=mipsel-linux-gnu \
    692 // RUN:   | FileCheck --check-prefix=CHECK-MIPSEL %s
    693 // CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}"
    694 // CHECK-MIPSEL: "-m" "elf32ltsmip"
    695 // CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib/ld.so.1"
    696 // CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
    697 //
    698 // RUN: %clang %s -### -o %t.o 2>&1 --target=mipsel-linux-gnu -mnan=2008 \
    699 // RUN:   | FileCheck --check-prefix=CHECK-MIPSEL-NAN2008 %s
    700 // CHECK-MIPSEL-NAN2008: "{{.*}}ld{{(.exe)?}}"
    701 // CHECK-MIPSEL-NAN2008: "-m" "elf32ltsmip"
    702 // CHECK-MIPSEL-NAN2008: "-dynamic-linker" "{{.*}}/lib/ld-linux-mipsn8.so.1"
    703 // CHECK-MIPSEL-NAN2008-NOT: "--hash-style={{gnu|both}}"
    704 //
    705 // RUN: %clang %s -### -o %t.o 2>&1 --target=mipsel-linux-gnu -mcpu=mips32r6 \
    706 // RUN:   | FileCheck --check-prefix=CHECK-MIPS32R6EL %s
    707 // CHECK-MIPS32R6EL: "{{.*}}ld{{(.exe)?}}"
    708 // CHECK-MIPS32R6EL: "-m" "elf32ltsmip"
    709 // CHECK-MIPS32R6EL: "-dynamic-linker" "{{.*}}/lib/ld-linux-mipsn8.so.1"
    710 // CHECK-MIPS32R6EL-NOT: "--hash-style={{gnu|both}}"
    711 //
    712 // RUN: %clang %s -### -o %t.o 2>&1 \
    713 // RUN:     --target=mips64-linux-gnu \
    714 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64 %s
    715 // CHECK-MIPS64: "{{.*}}ld{{(.exe)?}}"
    716 // CHECK-MIPS64: "-m" "elf64btsmip"
    717 // CHECK-MIPS64: "-dynamic-linker" "{{.*}}/lib64/ld.so.1"
    718 // CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
    719 //
    720 // RUN: %clang %s -### -o %t.o 2>&1 \
    721 // RUN:     --target=mips64el-linux-gnu \
    722 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL %s
    723 // CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}"
    724 // CHECK-MIPS64EL: "-m" "elf64ltsmip"
    725 // CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/lib64/ld.so.1"
    726 // CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"
    727 //
    728 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mnan=2008 \
    729 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-NAN2008 %s
    730 // CHECK-MIPS64EL-NAN2008: "{{.*}}ld{{(.exe)?}}"
    731 // CHECK-MIPS64EL-NAN2008: "-m" "elf64ltsmip"
    732 // CHECK-MIPS64EL-NAN2008: "-dynamic-linker" "{{.*}}/lib64/ld-linux-mipsn8.so.1"
    733 // CHECK-MIPS64EL-NAN2008-NOT: "--hash-style={{gnu|both}}"
    734 //
    735 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mcpu=mips64r6 \
    736 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64R6EL %s
    737 // CHECK-MIPS64R6EL: "{{.*}}ld{{(.exe)?}}"
    738 // CHECK-MIPS64R6EL: "-m" "elf64ltsmip"
    739 // CHECK-MIPS64R6EL: "-dynamic-linker" "{{.*}}/lib64/ld-linux-mipsn8.so.1"
    740 // CHECK-MIPS64R6EL-NOT: "--hash-style={{gnu|both}}"
    741 //
    742 // RUN: %clang %s -### -o %t.o 2>&1 \
    743 // RUN:     --target=mips64-linux-gnu -mabi=n32 \
    744 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64-N32 %s
    745 // CHECK-MIPS64-N32: "{{.*}}ld{{(.exe)?}}"
    746 // CHECK-MIPS64-N32: "-m" "elf32btsmipn32"
    747 // CHECK-MIPS64-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1"
    748 // CHECK-MIPS64-N32-NOT: "--hash-style={{gnu|both}}"
    749 //
    750 // RUN: %clang %s -### -o %t.o 2>&1 \
    751 // RUN:     --target=mips64el-linux-gnu -mabi=n32 \
    752 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-N32 %s
    753 // CHECK-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}"
    754 // CHECK-MIPS64EL-N32: "-m" "elf32ltsmipn32"
    755 // CHECK-MIPS64EL-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1"
    756 // CHECK-MIPS64EL-N32-NOT: "--hash-style={{gnu|both}}"
    757 //
    758 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mabi=n32 \
    759 // RUN:   -mnan=2008 | FileCheck --check-prefix=CHECK-MIPS64EL-N32-NAN2008 %s
    760 // CHECK-MIPS64EL-N32-NAN2008: "{{.*}}ld{{(.exe)?}}"
    761 // CHECK-MIPS64EL-N32-NAN2008: "-m" "elf32ltsmipn32"
    762 // CHECK-MIPS64EL-N32-NAN2008: "-dynamic-linker" "{{.*}}/lib32/ld-linux-mipsn8.so.1"
    763 // CHECK-MIPS64EL-N32-NAN2008-NOT: "--hash-style={{gnu|both}}"
    764 //
    765 // RUN: %clang %s -### -o %t.o 2>&1 \
    766 // RUN:     --target=sparc-unknown-linux-gnu \
    767 // RUN:   | FileCheck --check-prefix=CHECK-SPARCV8 %s
    768 // CHECK-SPARCV8: "{{.*}}ld{{(.exe)?}}"
    769 // CHECK-SPARCV8: "-m" "elf32_sparc"
    770 // CHECK-SPARCV8: "-dynamic-linker" "/lib/ld-linux.so.2"
    771 //
    772 // RUN: %clang %s -### -o %t.o 2>&1 \
    773 // RUN:     --target=sparcel-unknown-linux-gnu \
    774 // RUN:   | FileCheck --check-prefix=CHECK-SPARCV8EL %s
    775 // CHECK-SPARCV8EL: "{{.*}}ld{{(.exe)?}}"
    776 // CHECK-SPARCV8EL: "-m" "elf32_sparc"
    777 // CHECK-SPARCV8EL: "-dynamic-linker" "/lib/ld-linux.so.2"
    778 //
    779 // RUN: %clang %s -### -o %t.o 2>&1 \
    780 // RUN:     --target=sparcv9-unknown-linux-gnu \
    781 // RUN:   | FileCheck --check-prefix=CHECK-SPARCV9 %s
    782 // CHECK-SPARCV9: "{{.*}}ld{{(.exe)?}}"
    783 // CHECK-SPARCV9: "-m" "elf64_sparc"
    784 // CHECK-SPARCV9: "-dynamic-linker" "/lib64/ld-linux.so.2"
    785 //
    786 // Thoroughly exercise the Debian multiarch environment.
    787 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    788 // RUN:     --target=i686-linux-gnu \
    789 // RUN:     --gcc-toolchain="" \
    790 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    791 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s
    792 // CHECK-DEBIAN-X86: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    793 // CHECK-DEBIAN-X86: "{{.*}}/usr/lib/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    794 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5"
    795 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../i386-linux-gnu"
    796 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu"
    797 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../.."
    798 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/lib"
    799 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib"
    800 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    801 // RUN:     --target=x86_64-linux-gnu \
    802 // RUN:     --gcc-toolchain="" \
    803 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    804 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s
    805 // CHECK-DEBIAN-X86-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    806 // CHECK-DEBIAN-X86-64: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    807 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5"
    808 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../x86_64-linux-gnu"
    809 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu"
    810 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../.."
    811 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/lib"
    812 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib"
    813 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    814 // RUN:     --target=powerpc-linux-gnu \
    815 // RUN:     --gcc-toolchain="" \
    816 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    817 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s
    818 // CHECK-DEBIAN-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    819 // CHECK-DEBIAN-PPC: "{{.*}}/usr/lib/gcc/powerpc-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    820 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5"
    821 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../powerpc-linux-gnu"
    822 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/powerpc-linux-gnu"
    823 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../.."
    824 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/lib"
    825 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib"
    826 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    827 // RUN:     --target=powerpc64le-linux-gnu \
    828 // RUN:     --gcc-toolchain="" \
    829 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    830 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC64LE %s
    831 // CHECK-DEBIAN-PPC64LE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    832 // CHECK-DEBIAN-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    833 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.5"
    834 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.5/../../../powerpc64le-linux-gnu"
    835 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/usr/lib/powerpc64le-linux-gnu"
    836 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.5/../../.."
    837 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/lib"
    838 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/usr/lib"
    839 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    840 // RUN:     --target=powerpc64-linux-gnu \
    841 // RUN:     --gcc-toolchain="" \
    842 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    843 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s
    844 // CHECK-DEBIAN-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    845 // CHECK-DEBIAN-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    846 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5"
    847 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../powerpc64-linux-gnu"
    848 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/powerpc64-linux-gnu"
    849 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../.."
    850 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/lib"
    851 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib"
    852 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    853 // RUN:     --target=mips-linux-gnu \
    854 // RUN:     --gcc-toolchain="" \
    855 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    856 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS %s
    857 // CHECK-DEBIAN-MIPS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    858 // CHECK-DEBIAN-MIPS: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    859 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
    860 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../../mips-linux-gnu"
    861 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/mips-linux-gnu"
    862 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
    863 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/lib"
    864 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib"
    865 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    866 // RUN:     --target=mipsel-linux-gnu \
    867 // RUN:     --gcc-toolchain="" \
    868 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    869 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPSEL %s
    870 // CHECK-DEBIAN-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    871 // CHECK-DEBIAN-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    872 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
    873 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../../mipsel-linux-gnu"
    874 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/mipsel-linux-gnu"
    875 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
    876 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/lib"
    877 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib"
    878 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    879 // RUN:     --target=mips64-linux-gnu \
    880 // RUN:     --gcc-toolchain="" \
    881 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    882 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64 %s
    883 // CHECK-DEBIAN-MIPS64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    884 // CHECK-DEBIAN-MIPS64: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o"
    885 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/64"
    886 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
    887 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
    888 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/lib"
    889 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib"
    890 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    891 // RUN:     --target=mips64el-linux-gnu \
    892 // RUN:     --gcc-toolchain="" \
    893 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    894 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL %s
    895 // CHECK-DEBIAN-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    896 // CHECK-DEBIAN-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o"
    897 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/64"
    898 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
    899 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
    900 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/lib"
    901 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
    902 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    903 // RUN:     --target=mips64-linux-gnu -mabi=n32 \
    904 // RUN:     --gcc-toolchain="" \
    905 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    906 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64-N32 %s
    907 // CHECK-DEBIAN-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    908 // CHECK-DEBIAN-MIPS64-N32: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o"
    909 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/n32"
    910 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
    911 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
    912 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/lib"
    913 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib"
    914 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    915 // RUN:     --target=mips64el-linux-gnu -mabi=n32 \
    916 // RUN:     --gcc-toolchain="" \
    917 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    918 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL-N32 %s
    919 // CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    920 // CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o"
    921 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/n32"
    922 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
    923 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
    924 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/lib"
    925 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib"
    926 //
    927 // Check linker paths on Debian 8 / Sparc
    928 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    929 // RUN:     --target=sparc-linux-gnu \
    930 // RUN:     --gcc-toolchain="" \
    931 // RUN:     --sysroot=%S/Inputs/debian_8_sparc_multilib_tree \
    932 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC32 %s
    933 // CHECK-DEBIAN-SPARC32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    934 // CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu{{/|\\\\}}crt1.o"
    935 // CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu{{/|\\\\}}crti.o"
    936 // CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9{{/|\\\\}}crtbegin.o"
    937 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9"
    938 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu"
    939 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib"
    940 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/lib/sparc-linux-gnu"
    941 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/sparc-linux-gnu"
    942 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/lib"
    943 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib"
    944 // CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9{{/|\\\\}}crtend.o"
    945 // CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu{{/|\\\\}}crtn.o"
    946 //
    947 // Check linker paths on Debian 8 / Sparc, with the oldstyle multilib packages
    948 // RUN: %clang -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 \
    949 // RUN:     --target=sparc-linux-gnu \
    950 // RUN:     --gcc-toolchain="" \
    951 // RUN:     --sysroot=%S/Inputs/debian_8_sparc_multilib_tree \
    952 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC32-LIB64 %s
    953 // CHECK-DEBIAN-SPARC32-LIB64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    954 // CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64{{/|\\\\}}crt1.o"
    955 // CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64{{/|\\\\}}crti.o"
    956 // CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/64{{/|\\\\}}crtbegin.o"
    957 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/64"
    958 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64"
    959 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/lib/../lib64"
    960 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/../lib64"
    961 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9"
    962 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/lib"
    963 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib"
    964 // CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/64{{/|\\\\}}crtend.o"
    965 // CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64{{/|\\\\}}crtn.o"
    966 //
    967 // Check linker paths on Debian 8 / Sparc64
    968 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    969 // RUN:     --target=sparc64-linux-gnu \
    970 // RUN:     --gcc-toolchain="" \
    971 // RUN:     --sysroot=%S/Inputs/debian_8_sparc64_tree \
    972 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC64 %s
    973 // CHECK-DEBIAN-SPARC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    974 // CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu{{/|\\\\}}crt1.o"
    975 // CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu{{/|\\\\}}crti.o"
    976 // CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9{{/|\\\\}}crtbegin.o"
    977 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9"
    978 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu"
    979 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/lib/sparc64-linux-gnu"
    980 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/lib/../lib64"
    981 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/sparc64-linux-gnu"
    982 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../.."
    983 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/lib"
    984 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib"
    985 // CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9{{/|\\\\}}crtend.o"
    986 // CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu{{/|\\\\}}crtn.o"
    987 //
    988 // Test linker invocation on Android.
    989 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    990 // RUN:     --target=arm-linux-androideabi \
    991 // RUN:     --gcc-toolchain="" \
    992 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
    993 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
    994 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    995 // RUN:     --target=arm-linux-android \
    996 // RUN:     --gcc-toolchain="" \
    997 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
    998 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
    999 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1000 // RUN:     --target=aarch64-linux-android \
   1001 // RUN:     --gcc-toolchain="" \
   1002 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1003 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1004 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1005 // RUN:     --target=arm64-linux-android \
   1006 // RUN:     --gcc-toolchain="" \
   1007 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1008 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1009 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1010 // RUN:     --target=mipsel-linux-android \
   1011 // RUN:     --gcc-toolchain="" \
   1012 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1013 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1014 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1015 // RUN:     --target=mips64el-linux-android \
   1016 // RUN:     --gcc-toolchain="" \
   1017 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1018 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1019 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1020 // RUN:     --target=i686-linux-android \
   1021 // RUN:     --gcc-toolchain="" \
   1022 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1023 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1024 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1025 // RUN:     --target=x86_64-linux-android \
   1026 // RUN:     --gcc-toolchain="" \
   1027 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1028 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1029 // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1030 // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o"
   1031 // CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib"
   1032 // CHECK-ANDROID-NOT: "gcc_s"
   1033 // CHECK-ANDROID: "-lgcc"
   1034 // CHECK-ANDROID: "-ldl"
   1035 // CHECK-ANDROID-NOT: "gcc_s"
   1036 // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o"
   1037 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1038 // RUN:     --target=arm-linux-androideabi \
   1039 // RUN:     --gcc-toolchain="" \
   1040 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1041 // RUN:     -shared \
   1042 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1043 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1044 // RUN:     --target=arm-linux-android \
   1045 // RUN:     --gcc-toolchain="" \
   1046 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1047 // RUN:     -shared \
   1048 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1049 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1050 // RUN:     --target=aarch64-linux-android \
   1051 // RUN:     --gcc-toolchain="" \
   1052 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1053 // RUN:     -shared \
   1054 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1055 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1056 // RUN:     --target=arm64-linux-android \
   1057 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1058 // RUN:     -shared \
   1059 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1060 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1061 // RUN:     --target=mipsel-linux-android \
   1062 // RUN:     --gcc-toolchain="" \
   1063 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1064 // RUN:     -shared \
   1065 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1066 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1067 // RUN:     --target=mips64el-linux-android \
   1068 // RUN:     --gcc-toolchain="" \
   1069 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1070 // RUN:     -shared \
   1071 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1072 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1073 // RUN:     --target=i686-linux-android \
   1074 // RUN:     --gcc-toolchain="" \
   1075 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1076 // RUN:     -shared \
   1077 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1078 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1079 // RUN:     --target=x86_64-linux-android \
   1080 // RUN:     --gcc-toolchain="" \
   1081 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1082 // RUN:     -shared \
   1083 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1084 // CHECK-ANDROID-SO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1085 // CHECK-ANDROID-SO-NOT: "-Bsymbolic"
   1086 // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtbegin_so.o"
   1087 // CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib"
   1088 // CHECK-ANDROID-SO-NOT: "gcc_s"
   1089 // CHECK-ANDROID-SO: "-lgcc"
   1090 // CHECK-ANDROID-SO: "-ldl"
   1091 // CHECK-ANDROID-SO-NOT: "gcc_s"
   1092 // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o"
   1093 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1094 // RUN:     --target=arm-linux-androideabi \
   1095 // RUN:     --gcc-toolchain="" \
   1096 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1097 // RUN:     -static \
   1098 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1099 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1100 // RUN:     --target=arm-linux-android \
   1101 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1102 // RUN:     -static \
   1103 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1104 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1105 // RUN:     --target=aarch64-linux-android \
   1106 // RUN:     --gcc-toolchain="" \
   1107 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1108 // RUN:     -static \
   1109 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1110 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1111 // RUN:     --target=arm64-linux-android \
   1112 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1113 // RUN:     -static \
   1114 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1115 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1116 // RUN:     --target=mipsel-linux-android \
   1117 // RUN:     --gcc-toolchain="" \
   1118 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1119 // RUN:     -static \
   1120 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1121 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1122 // RUN:     --target=mips64el-linux-android \
   1123 // RUN:     --gcc-toolchain="" \
   1124 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1125 // RUN:     -static \
   1126 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1127 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1128 // RUN:     --target=i686-linux-android \
   1129 // RUN:     --gcc-toolchain="" \
   1130 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1131 // RUN:     -static \
   1132 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1133 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1134 // RUN:     --target=x86_64-linux-android \
   1135 // RUN:     --gcc-toolchain="" \
   1136 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1137 // RUN:     -static \
   1138 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1139 // CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1140 // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtbegin_static.o"
   1141 // CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib"
   1142 // CHECK-ANDROID-STATIC-NOT: "gcc_s"
   1143 // CHECK-ANDROID-STATIC: "-lgcc"
   1144 // CHECK-ANDROID-STATIC-NOT: "-ldl"
   1145 // CHECK-ANDROID-STATIC-NOT: "gcc_s"
   1146 // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o"
   1147 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1148 // RUN:     --target=arm-linux-androideabi \
   1149 // RUN:     --gcc-toolchain="" \
   1150 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot  \
   1151 // RUN:     -pie \
   1152 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1153 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1154 // RUN:     --target=arm-linux-android \
   1155 // RUN:     --gcc-toolchain="" \
   1156 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1157 // RUN:     -pie \
   1158 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1159 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1160 // RUN:     --target=aarch64-linux-android \
   1161 // RUN:     --gcc-toolchain="" \
   1162 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot  \
   1163 // RUN:     -pie \
   1164 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1165 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1166 // RUN:     --target=arm64-linux-android \
   1167 // RUN:     --gcc-toolchain="" \
   1168 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot  \
   1169 // RUN:     -pie \
   1170 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1171 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1172 // RUN:     --target=mipsel-linux-android \
   1173 // RUN:     --gcc-toolchain="" \
   1174 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1175 // RUN:     -pie \
   1176 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1177 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1178 // RUN:     --target=mips64el-linux-android \
   1179 // RUN:     --gcc-toolchain="" \
   1180 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1181 // RUN:     -pie \
   1182 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1183 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1184 // RUN:     --target=i686-linux-android \
   1185 // RUN:     --gcc-toolchain="" \
   1186 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1187 // RUN:     -pie \
   1188 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1189 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1190 // RUN:     --target=x86_64-linux-android \
   1191 // RUN:     --gcc-toolchain="" \
   1192 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1193 // RUN:     -pie \
   1194 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1195 // CHECK-ANDROID-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1196 // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o"
   1197 // CHECK-ANDROID-PIE: "-L[[SYSROOT]]/usr/lib"
   1198 // CHECK-ANDROID-PIE-NOT: "gcc_s"
   1199 // CHECK-ANDROID-PIE: "-lgcc"
   1200 // CHECK-ANDROID-PIE-NOT: "gcc_s"
   1201 // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtend_android.o"
   1202 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1203 // RUN:     --target=arm-linux-androideabi \
   1204 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1205 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1206 // RUN:     --target=arm-linux-android \
   1207 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1208 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1209 // RUN:     --target=aarch64-linux-android \
   1210 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1211 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1212 // RUN:     --target=arm64-linux-android \
   1213 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1214 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1215 // RUN:     --target=mipsel-linux-android \
   1216 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1217 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1218 // RUN:     --target=mips64el-linux-android \
   1219 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1220 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1221 // RUN:     --target=i686-linux-android \
   1222 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1223 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1224 // RUN:     --target=x86_64-linux-android \
   1225 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1226 // CHECK-ANDROID-NO-DEFAULT-PIE-NOT: -pie
   1227 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1228 // RUN:     --target=arm-linux-androideabi \
   1229 // RUN:     --gcc-toolchain="" \
   1230 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1231 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
   1232 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1233 // RUN:     --target=arm-linux-android \
   1234 // RUN:     --gcc-toolchain="" \
   1235 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1236 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
   1237 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1238 // RUN:     --target=mipsel-linux-android \
   1239 // RUN:     --gcc-toolchain="" \
   1240 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1241 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
   1242 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1243 // RUN:     --target=aarch64-linux-android \
   1244 // RUN:     --gcc-toolchain="" \
   1245 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1246 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
   1247 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1248 // RUN:     --target=arm64-linux-android \
   1249 // RUN:     --gcc-toolchain="" \
   1250 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1251 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
   1252 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1253 // RUN:     --target=mips64el-linux-android \
   1254 // RUN:     --gcc-toolchain="" \
   1255 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1256 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
   1257 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1258 // RUN:     --target=i686-linux-android \
   1259 // RUN:     --gcc-toolchain="" \
   1260 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1261 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
   1262 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1263 // RUN:     --target=x86_64-linux-android \
   1264 // RUN:     --gcc-toolchain="" \
   1265 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1266 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
   1267 // CHECK-ANDROID-32: "-dynamic-linker" "/system/bin/linker"
   1268 // CHECK-ANDROID-64: "-dynamic-linker" "/system/bin/linker64"
   1269 //
   1270 // Test that -pthread does not add -lpthread on Android.
   1271 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1272 // RUN:     --target=arm-linux-androideabi -pthread \
   1273 // RUN:     --gcc-toolchain="" \
   1274 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1275 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1276 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1277 // RUN:     --target=arm-linux-android -pthread \
   1278 // RUN:     --gcc-toolchain="" \
   1279 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1280 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1281 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1282 // RUN:     --target=aarch64-linux-android -pthread \
   1283 // RUN:     --gcc-toolchain="" \
   1284 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1285 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1286 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1287 // RUN:     --target=arm64-linux-android -pthread \
   1288 // RUN:     --gcc-toolchain="" \
   1289 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1290 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1291 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1292 // RUN:     --target=mipsel-linux-android -pthread \
   1293 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1294 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1295 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1296 // RUN:     --target=mips64el-linux-android -pthread \
   1297 // RUN:     --gcc-toolchain="" \
   1298 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1299 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1300 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1301 // RUN:     --target=i686-linux-android -pthread \
   1302 // RUN:     --gcc-toolchain="" \
   1303 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1304 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1305 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1306 // RUN:     --target=x86_64-linux-android -pthread \
   1307 // RUN:     --gcc-toolchain="" \
   1308 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1309 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1310 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1311 // RUN:     --target=arm-linux-androideabi -pthread \
   1312 // RUN:     --gcc-toolchain="" \
   1313 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1314 // RUN:     -shared \
   1315 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1316 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1317 // RUN:     --target=arm-linux-android -pthread \
   1318 // RUN:     --gcc-toolchain="" \
   1319 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1320 // RUN:     -shared \
   1321 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1322 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1323 // RUN:     --target=aarch64-linux-android -pthread \
   1324 // RUN:     --gcc-toolchain="" \
   1325 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1326 // RUN:     -shared \
   1327 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1328 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1329 // RUN:     --target=arm64-linux-android -pthread \
   1330 // RUN:     --gcc-toolchain="" \
   1331 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1332 // RUN:     -shared \
   1333 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1334 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1335 // RUN:     --target=mipsel-linux-android -pthread \
   1336 // RUN:     --gcc-toolchain="" \
   1337 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1338 // RUN:     -shared \
   1339 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1340 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1341 // RUN:     --target=mips64el-linux-android -pthread \
   1342 // RUN:     --gcc-toolchain="" \
   1343 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1344 // RUN:     -shared \
   1345 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1346 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1347 // RUN:     --target=i686-linux-android -pthread \
   1348 // RUN:     --gcc-toolchain="" \
   1349 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1350 // RUN:     -shared \
   1351 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1352 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1353 // RUN:     --target=x86_64-linux-android -pthread \
   1354 // RUN:     --gcc-toolchain="" \
   1355 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1356 // RUN:     -shared \
   1357 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1358 // CHECK-ANDROID-PTHREAD-NOT: -lpthread
   1359 //
   1360 // RUN: %clang -no-canonical-prefixes %t.o -### -o %t 2>&1 \
   1361 // RUN:     --target=arm-linux-androideabi -pthread \
   1362 // RUN:     --gcc-toolchain="" \
   1363 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1364 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD-LINK %s
   1365 // CHECK-ANDROID-PTHREAD-LINK-NOT: argument unused during compilation: '-pthread'
   1366 //
   1367 // Check linker invocation on Debian 6 MIPS 32/64-bit.
   1368 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1369 // RUN:     --target=mipsel-linux-gnu \
   1370 // RUN:     --gcc-toolchain="" \
   1371 // RUN:     --sysroot=%S/Inputs/debian_6_mips_tree \
   1372 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPSEL %s
   1373 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1374 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crt1.o"
   1375 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crti.o"
   1376 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4{{/|\\\\}}crtbegin.o"
   1377 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4"
   1378 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib"
   1379 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib/../lib"
   1380 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/../lib"
   1381 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.."
   1382 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib"
   1383 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib"
   1384 //
   1385 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1386 // RUN:     --target=mips64el-linux-gnu \
   1387 // RUN:     --gcc-toolchain="" \
   1388 // RUN:     --sysroot=%S/Inputs/debian_6_mips_tree \
   1389 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL %s
   1390 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1391 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crt1.o"
   1392 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crti.o"
   1393 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/64{{/|\\\\}}crtbegin.o"
   1394 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/64"
   1395 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64"
   1396 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib/../lib64"
   1397 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/../lib64"
   1398 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.."
   1399 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib"
   1400 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
   1401 //
   1402 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1403 // RUN:     --target=mips64el-linux-gnu -mabi=n32 \
   1404 // RUN:     --gcc-toolchain="" \
   1405 // RUN:     --sysroot=%S/Inputs/debian_6_mips_tree \
   1406 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-N32 %s
   1407 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1408 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crt1.o"
   1409 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crti.o"
   1410 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/n32{{/|\\\\}}crtbegin.o"
   1411 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/n32"
   1412 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32"
   1413 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib/../lib32"
   1414 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/../lib32"
   1415 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.."
   1416 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib"
   1417 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib"
   1418 //
   1419 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1420 // RUN:     --target=mips64-linux-gnuabi64 -mabi=n64 \
   1421 // RUN:     --gcc-toolchain="" \
   1422 // RUN:     --sysroot=%S/Inputs/debian_6_mips64_tree \
   1423 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64-GNUABI %s
   1424 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1425 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crt1.o"
   1426 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crti.o"
   1427 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtbegin.o"
   1428 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9"
   1429 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64"
   1430 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/lib/mips64-linux-gnuabi64"
   1431 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/mips64-linux-gnuabi64"
   1432 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9"
   1433 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../.."
   1434 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/lib"
   1435 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib"
   1436 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtend.o"
   1437 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crtn.o"
   1438 //
   1439 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1440 // RUN:     --target=mips64el-linux-gnuabi64 -mabi=n64 \
   1441 // RUN:     --gcc-toolchain="" \
   1442 // RUN:     --sysroot=%S/Inputs/debian_6_mips64_tree \
   1443 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-GNUABI %s
   1444 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1445 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crt1.o"
   1446 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crti.o"
   1447 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9{{/|\\\\}}crtbegin.o"
   1448 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9"
   1449 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64"
   1450 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/lib/mips64el-linux-gnuabi64"
   1451 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/mips64el-linux-gnuabi64"
   1452 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9"
   1453 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../.."
   1454 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/lib"
   1455 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib"
   1456 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9{{/|\\\\}}crtend.o"
   1457 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crtn.o"
   1458 //
   1459 // Test linker invocation for Freescale SDK (OpenEmbedded).
   1460 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1461 // RUN:     --target=powerpc-fsl-linux \
   1462 // RUN:     --gcc-toolchain="" \
   1463 // RUN:     --sysroot=%S/Inputs/freescale_ppc_tree \
   1464 // RUN:   | FileCheck --check-prefix=CHECK-FSL-PPC %s
   1465 // CHECK-FSL-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1466 // CHECK-FSL-PPC: "-m" "elf32ppclinux"
   1467 // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crt1.o"
   1468 // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crtbegin.o"
   1469 // CHECK-FSL-PPC: "-L[[SYSROOT]]/usr/lib"
   1470 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1471 // RUN:     --target=powerpc64-fsl-linux \
   1472 // RUN:     --gcc-toolchain="" \
   1473 // RUN:     --sysroot=%S/Inputs/freescale_ppc64_tree \
   1474 // RUN:   | FileCheck --check-prefix=CHECK-FSL-PPC64 %s
   1475 // CHECK-FSL-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1476 // CHECK-FSL-PPC64: "-m" "elf64ppc"
   1477 // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crt1.o"
   1478 // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crtbegin.o"
   1479 // CHECK-FSL-PPC64: "-L[[SYSROOT]]/usr/lib64/powerpc64-fsl-linux/4.6.2/../.."
   1480 //
   1481 // Check that crtfastmath.o is linked with -ffast-math and with -Ofast.
   1482 // RUN: %clang --target=x86_64-unknown-linux -### %s \
   1483 // RUN:        --gcc-toolchain="" \
   1484 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1485 // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
   1486 // RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math \
   1487 // RUN:        --gcc-toolchain="" \
   1488 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1489 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1490 // RUN: %clang --target=x86_64-unknown-linux -### %s -funsafe-math-optimizations\
   1491 // RUN:        --gcc-toolchain="" \
   1492 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1493 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1494 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast\
   1495 // RUN:        --gcc-toolchain="" \
   1496 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1497 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1498 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -O3\
   1499 // RUN:        --gcc-toolchain="" \
   1500 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1501 // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
   1502 // RUN: %clang --target=x86_64-unknown-linux -### %s -O3 -Ofast\
   1503 // RUN:        --gcc-toolchain="" \
   1504 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1505 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1506 // RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -fno-fast-math \
   1507 // RUN:        --gcc-toolchain="" \
   1508 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1509 // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
   1510 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-fast-math \
   1511 // RUN:        --gcc-toolchain="" \
   1512 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1513 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1514 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-unsafe-math-optimizations \
   1515 // RUN:        --gcc-toolchain="" \
   1516 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1517 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1518 // RUN: %clang --target=x86_64-unknown-linux -### %s -fno-fast-math -Ofast  \
   1519 // RUN:        --gcc-toolchain="" \
   1520 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1521 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1522 // RUN: %clang --target=x86_64-unknown-linux -### %s -fno-unsafe-math-optimizations -Ofast \
   1523 // RUN:        --gcc-toolchain="" \
   1524 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1525 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1526 // We don't have crtfastmath.o in the i386 tree, use it to check that file
   1527 // detection works.
   1528 // RUN: %clang --target=i386-unknown-linux -### %s -ffast-math \
   1529 // RUN:        --gcc-toolchain="" \
   1530 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1531 // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
   1532 // CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtfastmath.o
   1533 // CHECK-NOCRTFASTMATH-NOT: crtfastmath.o
   1534 
   1535 // Check that we link in gcrt1.o when compiling with -pg
   1536 // RUN: %clang -pg --target=x86_64-unknown-linux -### %s \
   1537 // RUN:        --gcc-toolchain="" \
   1538 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
   1539 // RUN:   | FileCheck --check-prefix=CHECK-PG %s
   1540 // CHECK-PG: gcrt1.o
   1541 
   1542 // GCC forwards -u to the linker.
   1543 // RUN: %clang -u asdf --target=x86_64-unknown-linux -### %s \
   1544 // RUN:        --gcc-toolchain="" \
   1545 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
   1546 // RUN:   | FileCheck --check-prefix=CHECK-u %s
   1547 // CHECK-u: "-u" "asdf"
   1548 
   1549 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1550 // RUN:     --target=armeb-unknown-linux \
   1551 // RUN:     --gcc-toolchain="" \
   1552 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
   1553 // RUN:   | FileCheck --check-prefix=CHECK-ARMEB %s
   1554 // CHECK-ARMEB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1555 // CHECK-ARMEB-NOT: "--be8"
   1556 // CHECK-ARMEB: "-m" "armebelf_linux_eabi"
   1557 
   1558 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1559 // RUN:     --target=armebv7-unknown-linux \
   1560 // RUN:     --gcc-toolchain="" \
   1561 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
   1562 // RUN:   | FileCheck --check-prefix=CHECK-ARMV7EB %s
   1563 // CHECK-ARMV7EB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1564 // CHECK-ARMV7EB: "--be8"
   1565 // CHECK-ARMV7EB: "-m" "armebelf_linux_eabi"
   1566