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 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    392 // RUN:     --target=i386-unknown-linux -m32 \
    393 // RUN:     -ccc-install-dir %S/Inputs/gcc_version_parsing5/bin \
    394 // RUN:     --gcc-toolchain="" \
    395 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
    396 // RUN:   | FileCheck --check-prefix=CHECK-GCC-VERSION5 %s
    397 // CHECK-GCC-VERSION5: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    398 // CHECK-GCC-VERSION5: "{{.*}}/Inputs/gcc_version_parsing5/bin/../lib/gcc/i386-unknown-linux/5{{/|\\\\}}crtbegin.o"
    399 // CHECK-GCC-VERSION5: "-L{{.*}}/Inputs/gcc_version_parsing5/bin/../lib/gcc/i386-unknown-linux/5"
    400 //
    401 // Test a simulated installation of libc++ on Linux, both through sysroot and
    402 // the installation path of Clang.
    403 // RUN: %clangxx -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \
    404 // RUN:     -target x86_64-unknown-linux-gnu \
    405 // RUN:     -stdlib=libc++ \
    406 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
    407 // RUN:     --gcc-toolchain="" \
    408 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree \
    409 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-SYSROOT %s
    410 // CHECK-BASIC-LIBCXX-SYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    411 // CHECK-BASIC-LIBCXX-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
    412 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"
    413 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    414 // CHECK-BASIC-LIBCXX-SYSROOT: "--sysroot=[[SYSROOT]]"
    415 // RUN: %clang -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \
    416 // RUN:     -target x86_64-unknown-linux-gnu \
    417 // RUN:     -stdlib=libc++ \
    418 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
    419 // RUN:     --gcc-toolchain="" \
    420 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree \
    421 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-INSTALL %s
    422 // CHECK-BASIC-LIBCXX-INSTALL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    423 // CHECK-BASIC-LIBCXX-INSTALL: "-isysroot" "[[SYSROOT:[^"]+]]"
    424 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1"
    425 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    426 // CHECK-BASIC-LIBCXX-INSTALL: "--sysroot=[[SYSROOT]]"
    427 // CHECK-BASIC-LIBCXX-INSTALL: "-L[[SYSROOT]]/usr/bin/../lib"
    428 //
    429 // Test that we can use -stdlib=libc++ in a build system even when it
    430 // occasionally links C code instead of C++ code.
    431 // RUN: %clang -no-canonical-prefixes -x c %s -### -o %t.o 2>&1 \
    432 // RUN:     -target x86_64-unknown-linux-gnu \
    433 // RUN:     -stdlib=libc++ \
    434 // RUN:     -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
    435 // RUN:     --gcc-toolchain="" \
    436 // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree \
    437 // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-C-LINK %s
    438 // CHECK-BASIC-LIBCXX-C-LINK-NOT: warning:
    439 // CHECK-BASIC-LIBCXX-C-LINK: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
    440 // CHECK-BASIC-LIBCXX-C-LINK: "-isysroot" "[[SYSROOT:[^"]+]]"
    441 // CHECK-BASIC-LIBCXX-C-LINK-NOT: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1"
    442 // CHECK-BASIC-LIBCXX-C-LINK: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
    443 // CHECK-BASIC-LIBCXX-C-LINK: "--sysroot=[[SYSROOT]]"
    444 // CHECK-BASIC-LIBCXX-C-LINK: "-L[[SYSROOT]]/usr/bin/../lib"
    445 //
    446 // Test a very broken version of multiarch that shipped in Ubuntu 11.04.
    447 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    448 // RUN:     --target=i386-unknown-linux \
    449 // RUN:     --gcc-toolchain="" \
    450 // RUN:     --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
    451 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
    452 // CHECK-UBUNTU-11-04: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    453 // CHECK-UBUNTU-11-04: "{{.*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    454 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5"
    455 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../i386-linux-gnu"
    456 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu"
    457 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.."
    458 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/lib"
    459 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib"
    460 //
    461 // Check multi arch support on Ubuntu 12.04 LTS.
    462 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    463 // RUN:     --target=arm-unknown-linux-gnueabihf \
    464 // RUN:     --gcc-toolchain="" \
    465 // RUN:     --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
    466 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM-HF %s
    467 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    468 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crt1.o"
    469 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crti.o"
    470 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtbegin.o"
    471 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3"
    472 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf"
    473 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/lib/arm-linux-gnueabihf"
    474 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabihf"
    475 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../.."
    476 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtend.o"
    477 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crtn.o"
    478 //
    479 // Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabihf.
    480 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    481 // RUN:     --target=arm-linux-gnueabihf \
    482 // RUN:     --gcc-toolchain="" \
    483 // RUN:     --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
    484 // RUN:   | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM-HF %s
    485 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    486 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-dynamic-linker" "{{(/usr/arm--linux-gnueabihf)?}}/lib/ld-linux-armhf.so.3"
    487 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crt1.o"
    488 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crti.o"
    489 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtbegin.o"
    490 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8"
    491 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib"
    492 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/lib/../lib"
    493 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/../lib"
    494 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib"
    495 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtend.o"
    496 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crtn.o"
    497 //
    498 // Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabi.
    499 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    500 // RUN:     --target=arm-linux-gnueabi \
    501 // RUN:     --gcc-toolchain="" \
    502 // RUN:     --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
    503 // RUN:   | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM %s
    504 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    505 // CHECK-X86-64-UBUNTU-13-10-ARM: "-dynamic-linker" "{{(/usr/arm--linux-gnueabi)?}}/lib/ld-linux.so.3"
    506 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crt1.o"
    507 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crti.o"
    508 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtbegin.o"
    509 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7"
    510 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib"
    511 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/lib/../lib"
    512 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/../lib"
    513 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib"
    514 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtend.o"
    515 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crtn.o"
    516 //
    517 // Check Ubuntu 14.04 on powerpc64le.
    518 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    519 // RUN:     --target=powerpc64le-unknown-linux-gnu \
    520 // RUN:     --gcc-toolchain="" \
    521 // RUN:     --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
    522 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-14-04-PPC64LE %s
    523 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    524 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crt1.o"
    525 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crti.o"
    526 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8{{/|\\\\}}crtbegin.o"
    527 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8"
    528 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu"
    529 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/lib/powerpc64le-linux-gnu"
    530 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/powerpc64le-linux-gnu"
    531 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../.."
    532 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8{{/|\\\\}}crtend.o"
    533 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crtn.o"
    534 //
    535 // Check Ubuntu 14.04 on x32.
    536 // "/usr/lib/gcc/x86_64-linux-gnu/4.8/x32/crtend.o" "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32/crtn.o"
    537 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    538 // RUN:     --target=x86_64-unknown-linux-gnux32 \
    539 // RUN:     --gcc-toolchain="" \
    540 // RUN:     --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
    541 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-14-04-X32 %s
    542 // CHECK-UBUNTU-14-04-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    543 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crt1.o"
    544 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crti.o"
    545 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/x32{{/|\\\\}}crtbegin.o"
    546 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/x32"
    547 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32"
    548 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/lib/../libx32"
    549 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
    550 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu/../../libx32"
    551 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8"
    552 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.."
    553 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/x32{{/|\\\\}}crtend.o"
    554 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crtn.o"
    555 //
    556 // Check fedora 18 on arm.
    557 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    558 // RUN:     --target=armv7-unknown-linux-gnueabihf \
    559 // RUN:     --gcc-toolchain="" \
    560 // RUN:     --sysroot=%S/Inputs/fedora_18_tree \
    561 // RUN:   | FileCheck --check-prefix=CHECK-FEDORA-18-ARM-HF %s
    562 // CHECK-FEDORA-18-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    563 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crt1.o"
    564 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crti.o"
    565 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtbegin.o"
    566 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2"
    567 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib"
    568 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtend.o"
    569 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crtn.o"
    570 //
    571 // Check Fedora 21 on AArch64.
    572 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    573 // RUN:     --target=arm64-unknown-linux-gnu \
    574 // RUN:     --gcc-toolchain="" \
    575 // RUN:     --sysroot=%S/Inputs/fedora_21_tree \
    576 // RUN:   | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s
    577 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    578 // RUN:     --target=aarch64-unknown-linux-gnu \
    579 // RUN:     --gcc-toolchain="" \
    580 // RUN:     --sysroot=%S/Inputs/fedora_21_tree \
    581 // RUN:   | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s
    582 // CHECK-FEDORA-21-AARCH64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    583 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crt1.o"
    584 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crti.o"
    585 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|\\\\}}crtbegin.o"
    586 // CHECK-FEDORA-21-AARCH64: "-L[[SYSROOT]]/usr/lib/gcc/aarch64-redhat-linux/4.9.0"
    587 // CHECK-FEDORA-21-AARCH64: "-L[[SYSROOT]]/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64"
    588 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|\\\\}}crtend.o"
    589 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crtn.o"
    590 //
    591 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    592 // RUN:     --target=arm-unknown-linux-gnueabi \
    593 // RUN:     --gcc-toolchain="" \
    594 // RUN:     --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
    595 // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM %s
    596 // CHECK-UBUNTU-12-04-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    597 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crt1.o"
    598 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crti.o"
    599 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtbegin.o"
    600 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1"
    601 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi"
    602 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/lib/arm-linux-gnueabi"
    603 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabi"
    604 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../.."
    605 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtend.o"
    606 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crtn.o"
    607 //
    608 // Test the setup that shipped in SUSE 10.3 on ppc64.
    609 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    610 // RUN:     --target=powerpc64-suse-linux \
    611 // RUN:     --gcc-toolchain="" \
    612 // RUN:     --sysroot=%S/Inputs/suse_10.3_ppc64_tree \
    613 // RUN:   | FileCheck --check-prefix=CHECK-SUSE-10-3-PPC64 %s
    614 // CHECK-SUSE-10-3-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    615 // CHECK-SUSE-10-3-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64{{/|\\\\}}crtbegin.o"
    616 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64"
    617 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib64"
    618 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/lib/../lib64"
    619 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/../lib64"
    620 //
    621 // Check dynamic-linker for different archs
    622 // RUN: %clang %s -### -o %t.o 2>&1 \
    623 // RUN:     --target=arm-linux-gnueabi \
    624 // RUN:   | FileCheck --check-prefix=CHECK-ARM %s
    625 // CHECK-ARM: "{{.*}}ld{{(.exe)?}}"
    626 // CHECK-ARM: "-m" "armelf_linux_eabi"
    627 // CHECK-ARM: "-dynamic-linker" "{{.*}}/lib/ld-linux.so.3"
    628 //
    629 // RUN: %clang %s -### -o %t.o 2>&1 \
    630 // RUN:     --target=arm-linux-gnueabi -mfloat-abi=hard \
    631 // RUN:   | FileCheck --check-prefix=CHECK-ARM-ABIHF %s
    632 // CHECK-ARM-ABIHF: "{{.*}}ld{{(.exe)?}}"
    633 // CHECK-ARM-ABIHF: "-m" "armelf_linux_eabi"
    634 // CHECK-ARM-ABIHF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3"
    635 //
    636 // RUN: %clang %s -### -o %t.o 2>&1 \
    637 // RUN:     --target=arm-linux-gnueabihf \
    638 // RUN:   | FileCheck --check-prefix=CHECK-ARM-HF %s
    639 // CHECK-ARM-HF: "{{.*}}ld{{(.exe)?}}"
    640 // CHECK-ARM-HF: "-m" "armelf_linux_eabi"
    641 // CHECK-ARM-HF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3"
    642 //
    643 // RUN: %clang %s -### -o %t.o 2>&1 \
    644 // RUN:     --target=powerpc64-linux-gnu \
    645 // RUN:   | FileCheck --check-prefix=CHECK-PPC64 %s
    646 // CHECK-PPC64: "{{.*}}ld{{(.exe)?}}"
    647 // CHECK-PPC64: "-m" "elf64ppc"
    648 // CHECK-PPC64: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.1"
    649 //
    650 // RUN: %clang %s -### -o %t.o 2>&1 \
    651 // RUN:     --target=powerpc64-linux-gnu -mabi=elfv1 \
    652 // RUN:   | FileCheck --check-prefix=CHECK-PPC64-ELFv1 %s
    653 // RUN: %clang %s -### -o %t.o 2>&1 \
    654 // RUN:     --target=powerpc64-linux-gnu -mabi=elfv1-qpx \
    655 // RUN:   | FileCheck --check-prefix=CHECK-PPC64-ELFv1 %s
    656 // CHECK-PPC64-ELFv1: "{{.*}}ld{{(.exe)?}}"
    657 // CHECK-PPC64-ELFv1: "-m" "elf64ppc"
    658 // CHECK-PPC64-ELFv1: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.1"
    659 //
    660 // RUN: %clang %s -### -o %t.o 2>&1 \
    661 // RUN:     --target=powerpc64-linux-gnu -mabi=elfv2 \
    662 // RUN:   | FileCheck --check-prefix=CHECK-PPC64-ELFv2 %s
    663 // CHECK-PPC64-ELFv2: "{{.*}}ld{{(.exe)?}}"
    664 // CHECK-PPC64-ELFv2: "-m" "elf64ppc"
    665 // CHECK-PPC64-ELFv2: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.2"
    666 //
    667 // RUN: %clang %s -### -o %t.o 2>&1 \
    668 // RUN:     --target=powerpc64le-linux-gnu \
    669 // RUN:   | FileCheck --check-prefix=CHECK-PPC64LE %s
    670 // CHECK-PPC64LE: "{{.*}}ld{{(.exe)?}}"
    671 // CHECK-PPC64LE: "-m" "elf64lppc"
    672 // CHECK-PPC64LE: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.2"
    673 //
    674 // RUN: %clang %s -### -o %t.o 2>&1 \
    675 // RUN:     --target=powerpc64le-linux-gnu -mabi=elfv1 \
    676 // RUN:   | FileCheck --check-prefix=CHECK-PPC64LE-ELFv1 %s
    677 // CHECK-PPC64LE-ELFv1: "{{.*}}ld{{(.exe)?}}"
    678 // CHECK-PPC64LE-ELFv1: "-m" "elf64lppc"
    679 // CHECK-PPC64LE-ELFv1: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.1"
    680 //
    681 // RUN: %clang %s -### -o %t.o 2>&1 \
    682 // RUN:     --target=powerpc64le-linux-gnu -mabi=elfv2 \
    683 // RUN:   | FileCheck --check-prefix=CHECK-PPC64LE-ELFv2 %s
    684 // CHECK-PPC64LE-ELFv2: "{{.*}}ld{{(.exe)?}}"
    685 // CHECK-PPC64LE-ELFv2: "-m" "elf64lppc"
    686 // CHECK-PPC64LE-ELFv2: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld64.so.2"
    687 //
    688 // Check that we do not pass --hash-style=gnu and --hash-style=both to linker
    689 // and provide correct path to the dynamic linker and emulation mode when build
    690 // for MIPS platforms.
    691 // RUN: %clang %s -### -o %t.o 2>&1 \
    692 // RUN:     --target=mips-linux-gnu \
    693 // RUN:   | FileCheck --check-prefix=CHECK-MIPS %s
    694 // CHECK-MIPS: "{{.*}}ld{{(.exe)?}}"
    695 // CHECK-MIPS: "-m" "elf32btsmip"
    696 // CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1"
    697 // CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
    698 //
    699 // RUN: %clang %s -### -o %t.o 2>&1 \
    700 // RUN:     --target=mipsel-linux-gnu \
    701 // RUN:   | FileCheck --check-prefix=CHECK-MIPSEL %s
    702 // CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}"
    703 // CHECK-MIPSEL: "-m" "elf32ltsmip"
    704 // CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib/ld.so.1"
    705 // CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
    706 //
    707 // RUN: %clang %s -### -o %t.o 2>&1 --target=mipsel-linux-gnu -mnan=2008 \
    708 // RUN:   | FileCheck --check-prefix=CHECK-MIPSEL-NAN2008 %s
    709 // CHECK-MIPSEL-NAN2008: "{{.*}}ld{{(.exe)?}}"
    710 // CHECK-MIPSEL-NAN2008: "-m" "elf32ltsmip"
    711 // CHECK-MIPSEL-NAN2008: "-dynamic-linker" "{{.*}}/lib/ld-linux-mipsn8.so.1"
    712 // CHECK-MIPSEL-NAN2008-NOT: "--hash-style={{gnu|both}}"
    713 //
    714 // RUN: %clang %s -### -o %t.o 2>&1 --target=mipsel-linux-gnu -mcpu=mips32r6 \
    715 // RUN:   | FileCheck --check-prefix=CHECK-MIPS32R6EL %s
    716 // CHECK-MIPS32R6EL: "{{.*}}ld{{(.exe)?}}"
    717 // CHECK-MIPS32R6EL: "-m" "elf32ltsmip"
    718 // CHECK-MIPS32R6EL: "-dynamic-linker" "{{.*}}/lib/ld-linux-mipsn8.so.1"
    719 // CHECK-MIPS32R6EL-NOT: "--hash-style={{gnu|both}}"
    720 //
    721 // RUN: %clang %s -### -o %t.o 2>&1 \
    722 // RUN:     --target=mips64-linux-gnu \
    723 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64 %s
    724 // CHECK-MIPS64: "{{.*}}ld{{(.exe)?}}"
    725 // CHECK-MIPS64: "-m" "elf64btsmip"
    726 // CHECK-MIPS64: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld.so.1"
    727 // CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
    728 //
    729 // RUN: %clang %s -### -o %t.o 2>&1 \
    730 // RUN:     --target=mips64el-linux-gnu \
    731 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL %s
    732 // CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}"
    733 // CHECK-MIPS64EL: "-m" "elf64ltsmip"
    734 // CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld.so.1"
    735 // CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"
    736 //
    737 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mnan=2008 \
    738 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-NAN2008 %s
    739 // CHECK-MIPS64EL-NAN2008: "{{.*}}ld{{(.exe)?}}"
    740 // CHECK-MIPS64EL-NAN2008: "-m" "elf64ltsmip"
    741 // CHECK-MIPS64EL-NAN2008: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld-linux-mipsn8.so.1"
    742 // CHECK-MIPS64EL-NAN2008-NOT: "--hash-style={{gnu|both}}"
    743 //
    744 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mcpu=mips64r6 \
    745 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64R6EL %s
    746 // CHECK-MIPS64R6EL: "{{.*}}ld{{(.exe)?}}"
    747 // CHECK-MIPS64R6EL: "-m" "elf64ltsmip"
    748 // CHECK-MIPS64R6EL: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld-linux-mipsn8.so.1"
    749 // CHECK-MIPS64R6EL-NOT: "--hash-style={{gnu|both}}"
    750 //
    751 // RUN: %clang %s -### -o %t.o 2>&1 \
    752 // RUN:     --target=mips64-linux-gnu -mabi=n32 \
    753 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64-N32 %s
    754 // CHECK-MIPS64-N32: "{{.*}}ld{{(.exe)?}}"
    755 // CHECK-MIPS64-N32: "-m" "elf32btsmipn32"
    756 // CHECK-MIPS64-N32: "-dynamic-linker" "{{.*}}/lib{{(32)?}}/ld.so.1"
    757 // CHECK-MIPS64-N32-NOT: "--hash-style={{gnu|both}}"
    758 //
    759 // RUN: %clang %s -### -o %t.o 2>&1 \
    760 // RUN:     --target=mips64el-linux-gnu -mabi=n32 \
    761 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-N32 %s
    762 // CHECK-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}"
    763 // CHECK-MIPS64EL-N32: "-m" "elf32ltsmipn32"
    764 // CHECK-MIPS64EL-N32: "-dynamic-linker" "{{.*}}/lib{{(32)?}}/ld.so.1"
    765 // CHECK-MIPS64EL-N32-NOT: "--hash-style={{gnu|both}}"
    766 //
    767 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mabi=n32 \
    768 // RUN:   -mnan=2008 | FileCheck --check-prefix=CHECK-MIPS64EL-N32-NAN2008 %s
    769 // CHECK-MIPS64EL-N32-NAN2008: "{{.*}}ld{{(.exe)?}}"
    770 // CHECK-MIPS64EL-N32-NAN2008: "-m" "elf32ltsmipn32"
    771 // CHECK-MIPS64EL-N32-NAN2008: "-dynamic-linker" "{{.*}}/lib{{(32)?}}/ld-linux-mipsn8.so.1"
    772 // CHECK-MIPS64EL-N32-NAN2008-NOT: "--hash-style={{gnu|both}}"
    773 //
    774 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-redhat-linux \
    775 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-REDHAT %s
    776 // CHECK-MIPS64EL-REDHAT: "{{.*}}ld{{(.exe)?}}"
    777 // CHECK-MIPS64EL-REDHAT: "-m" "elf64ltsmip"
    778 // CHECK-MIPS64EL-REDHAT: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld.so.1"
    779 // CHECK-MIPS64EL-REDHAT-NOT: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld-musl-mipsel.so.1"
    780 // CHECK-MIPS64EL-REDHAT-NOT: "--hash-style={{gnu|both}}"
    781 //
    782 // RUN: %clang %s -### -o %t.o 2>&1 \
    783 // RUN:     --target=sparc-unknown-linux-gnu \
    784 // RUN:   | FileCheck --check-prefix=CHECK-SPARCV8 %s
    785 // CHECK-SPARCV8: "{{.*}}ld{{(.exe)?}}"
    786 // CHECK-SPARCV8: "-m" "elf32_sparc"
    787 // CHECK-SPARCV8: "-dynamic-linker" "{{(/usr/sparc-unknown-linux-gnu)?}}/lib/ld-linux.so.2"
    788 //
    789 // RUN: %clang %s -### -o %t.o 2>&1 \
    790 // RUN:     --target=sparcel-unknown-linux-gnu \
    791 // RUN:   | FileCheck --check-prefix=CHECK-SPARCV8EL %s
    792 // CHECK-SPARCV8EL: "{{.*}}ld{{(.exe)?}}"
    793 // CHECK-SPARCV8EL: "-m" "elf32_sparc"
    794 // CHECK-SPARCV8EL: "-dynamic-linker" "{{(/usr/sparcel-unknown-linux-gnu)?}}/lib/ld-linux.so.2"
    795 //
    796 // RUN: %clang %s -### -o %t.o 2>&1 \
    797 // RUN:     --target=sparcv9-unknown-linux-gnu \
    798 // RUN:   | FileCheck --check-prefix=CHECK-SPARCV9 %s
    799 // CHECK-SPARCV9: "{{.*}}ld{{(.exe)?}}"
    800 // CHECK-SPARCV9: "-m" "elf64_sparc"
    801 // CHECK-SPARCV9: "-dynamic-linker" "{{(/usr/sparcv9-unknown-linux-gnu)?}}/lib{{(64)?}}/ld-linux.so.2"
    802 //
    803 // Thoroughly exercise the Debian multiarch environment.
    804 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    805 // RUN:     --target=i686-linux-gnu \
    806 // RUN:     --gcc-toolchain="" \
    807 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    808 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s
    809 // CHECK-DEBIAN-X86: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    810 // CHECK-DEBIAN-X86: "{{.*}}/usr/lib/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    811 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5"
    812 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../i386-linux-gnu"
    813 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu"
    814 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../.."
    815 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/lib"
    816 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib"
    817 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    818 // RUN:     --target=x86_64-linux-gnu \
    819 // RUN:     --gcc-toolchain="" \
    820 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    821 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s
    822 // CHECK-DEBIAN-X86-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    823 // CHECK-DEBIAN-X86-64: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    824 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5"
    825 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../x86_64-linux-gnu"
    826 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu"
    827 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../.."
    828 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/lib"
    829 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib"
    830 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    831 // RUN:     --target=powerpc-linux-gnu \
    832 // RUN:     --gcc-toolchain="" \
    833 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    834 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s
    835 // CHECK-DEBIAN-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    836 // CHECK-DEBIAN-PPC: "{{.*}}/usr/lib/gcc/powerpc-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    837 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5"
    838 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../powerpc-linux-gnu"
    839 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/powerpc-linux-gnu"
    840 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../.."
    841 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/lib"
    842 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib"
    843 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    844 // RUN:     --target=powerpc64le-linux-gnu \
    845 // RUN:     --gcc-toolchain="" \
    846 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    847 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC64LE %s
    848 // CHECK-DEBIAN-PPC64LE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    849 // CHECK-DEBIAN-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    850 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.5"
    851 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.5/../../../powerpc64le-linux-gnu"
    852 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/usr/lib/powerpc64le-linux-gnu"
    853 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.5/../../.."
    854 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/lib"
    855 // CHECK-DEBIAN-PPC64LE: "-L[[SYSROOT]]/usr/lib"
    856 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    857 // RUN:     --target=powerpc64-linux-gnu \
    858 // RUN:     --gcc-toolchain="" \
    859 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    860 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s
    861 // CHECK-DEBIAN-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    862 // CHECK-DEBIAN-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    863 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5"
    864 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../powerpc64-linux-gnu"
    865 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/powerpc64-linux-gnu"
    866 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../.."
    867 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/lib"
    868 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib"
    869 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    870 // RUN:     --target=mips-linux-gnu \
    871 // RUN:     --gcc-toolchain="" \
    872 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    873 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS %s
    874 // CHECK-DEBIAN-MIPS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    875 // CHECK-DEBIAN-MIPS: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    876 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
    877 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../../mips-linux-gnu"
    878 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/mips-linux-gnu"
    879 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
    880 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/lib"
    881 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib"
    882 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    883 // RUN:     --target=mipsel-linux-gnu \
    884 // RUN:     --gcc-toolchain="" \
    885 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    886 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPSEL %s
    887 // CHECK-DEBIAN-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    888 // CHECK-DEBIAN-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
    889 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
    890 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../../mipsel-linux-gnu"
    891 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/mipsel-linux-gnu"
    892 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
    893 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/lib"
    894 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib"
    895 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    896 // RUN:     --target=mips64-linux-gnu \
    897 // RUN:     --gcc-toolchain="" \
    898 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    899 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64 %s
    900 // CHECK-DEBIAN-MIPS64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    901 // CHECK-DEBIAN-MIPS64: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o"
    902 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/64"
    903 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
    904 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
    905 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/lib"
    906 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib"
    907 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    908 // RUN:     --target=mips64el-linux-gnu \
    909 // RUN:     --gcc-toolchain="" \
    910 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    911 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL %s
    912 // CHECK-DEBIAN-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    913 // CHECK-DEBIAN-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o"
    914 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/64"
    915 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
    916 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
    917 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/lib"
    918 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
    919 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    920 // RUN:     --target=mips64-linux-gnu -mabi=n32 \
    921 // RUN:     --gcc-toolchain="" \
    922 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    923 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64-N32 %s
    924 // CHECK-DEBIAN-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    925 // CHECK-DEBIAN-MIPS64-N32: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o"
    926 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/n32"
    927 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
    928 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
    929 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/lib"
    930 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib"
    931 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    932 // RUN:     --target=mips64el-linux-gnu -mabi=n32 \
    933 // RUN:     --gcc-toolchain="" \
    934 // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
    935 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL-N32 %s
    936 // CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    937 // CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o"
    938 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/n32"
    939 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
    940 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
    941 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/lib"
    942 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib"
    943 //
    944 // Check linker paths on Debian 8 / Sparc
    945 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    946 // RUN:     --target=sparc-linux-gnu \
    947 // RUN:     --gcc-toolchain="" \
    948 // RUN:     --sysroot=%S/Inputs/debian_8_sparc_multilib_tree \
    949 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC32 %s
    950 // CHECK-DEBIAN-SPARC32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    951 // CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu{{/|\\\\}}crt1.o"
    952 // CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu{{/|\\\\}}crti.o"
    953 // CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9{{/|\\\\}}crtbegin.o"
    954 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9"
    955 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu"
    956 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib"
    957 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/lib/sparc-linux-gnu"
    958 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib/sparc-linux-gnu"
    959 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/lib"
    960 // CHECK-DEBIAN-SPARC32: "-L[[SYSROOT]]/usr/lib"
    961 // CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9{{/|\\\\}}crtend.o"
    962 // CHECK-DEBIAN-SPARC32: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../sparc-linux-gnu{{/|\\\\}}crtn.o"
    963 //
    964 // Check linker paths on Debian 8 / Sparc, with the oldstyle multilib packages
    965 // RUN: %clang -no-canonical-prefixes -m64 %s -### -o %t.o 2>&1 \
    966 // RUN:     --target=sparc-linux-gnu \
    967 // RUN:     --gcc-toolchain="" \
    968 // RUN:     --sysroot=%S/Inputs/debian_8_sparc_multilib_tree \
    969 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC32-LIB64 %s
    970 // CHECK-DEBIAN-SPARC32-LIB64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    971 // CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64{{/|\\\\}}crt1.o"
    972 // CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64{{/|\\\\}}crti.o"
    973 // CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/64{{/|\\\\}}crtbegin.o"
    974 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/64"
    975 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64"
    976 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/lib/../lib64"
    977 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/../lib64"
    978 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9"
    979 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/lib"
    980 // CHECK-DEBIAN-SPARC32-LIB64: "-L[[SYSROOT]]/usr/lib"
    981 // CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/64{{/|\\\\}}crtend.o"
    982 // CHECK-DEBIAN-SPARC32-LIB64: "[[SYSROOT]]/usr/lib/gcc/sparc-linux-gnu/4.9/../../../../lib64{{/|\\\\}}crtn.o"
    983 //
    984 // Check linker paths on Debian 8 / Sparc64
    985 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
    986 // RUN:     --target=sparc64-linux-gnu \
    987 // RUN:     --gcc-toolchain="" \
    988 // RUN:     --sysroot=%S/Inputs/debian_8_sparc64_tree \
    989 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-SPARC64 %s
    990 // CHECK-DEBIAN-SPARC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
    991 // CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu{{/|\\\\}}crt1.o"
    992 // CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu{{/|\\\\}}crti.o"
    993 // CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9{{/|\\\\}}crtbegin.o"
    994 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9"
    995 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu"
    996 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/lib/sparc64-linux-gnu"
    997 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/lib/../lib64"
    998 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/sparc64-linux-gnu"
    999 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../.."
   1000 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/lib"
   1001 // CHECK-DEBIAN-SPARC64: "-L[[SYSROOT]]/usr/lib"
   1002 // CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9{{/|\\\\}}crtend.o"
   1003 // CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu{{/|\\\\}}crtn.o"
   1004 //
   1005 // Test linker invocation on Android.
   1006 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1007 // RUN:     --target=arm-linux-androideabi \
   1008 // RUN:     --gcc-toolchain="" \
   1009 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1010 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1011 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1012 // RUN:     --target=arm-linux-android \
   1013 // RUN:     --gcc-toolchain="" \
   1014 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1015 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1016 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1017 // RUN:     --target=aarch64-linux-android \
   1018 // RUN:     --gcc-toolchain="" \
   1019 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1020 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1021 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1022 // RUN:     --target=arm64-linux-android \
   1023 // RUN:     --gcc-toolchain="" \
   1024 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1025 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1026 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1027 // RUN:     --target=mipsel-linux-android \
   1028 // RUN:     --gcc-toolchain="" \
   1029 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1030 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1031 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1032 // RUN:     --target=mips64el-linux-android \
   1033 // RUN:     --gcc-toolchain="" \
   1034 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1035 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1036 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1037 // RUN:     --target=i686-linux-android \
   1038 // RUN:     --gcc-toolchain="" \
   1039 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1040 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1041 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1042 // RUN:     --target=x86_64-linux-android \
   1043 // RUN:     --gcc-toolchain="" \
   1044 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1045 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
   1046 // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1047 // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o"
   1048 // CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib"
   1049 // CHECK-ANDROID-NOT: "gcc_s"
   1050 // CHECK-ANDROID: "-lgcc"
   1051 // CHECK-ANDROID: "-ldl"
   1052 // CHECK-ANDROID-NOT: "gcc_s"
   1053 // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o"
   1054 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1055 // RUN:     --target=arm-linux-androideabi \
   1056 // RUN:     --gcc-toolchain="" \
   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=arm-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=aarch64-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=arm64-linux-android \
   1074 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1075 // RUN:     -shared \
   1076 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1077 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1078 // RUN:     --target=mipsel-linux-android \
   1079 // RUN:     --gcc-toolchain="" \
   1080 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1081 // RUN:     -shared \
   1082 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1083 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1084 // RUN:     --target=mips64el-linux-android \
   1085 // RUN:     --gcc-toolchain="" \
   1086 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1087 // RUN:     -shared \
   1088 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1089 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1090 // RUN:     --target=i686-linux-android \
   1091 // RUN:     --gcc-toolchain="" \
   1092 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1093 // RUN:     -shared \
   1094 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1095 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1096 // RUN:     --target=x86_64-linux-android \
   1097 // RUN:     --gcc-toolchain="" \
   1098 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1099 // RUN:     -shared \
   1100 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
   1101 // CHECK-ANDROID-SO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1102 // CHECK-ANDROID-SO-NOT: "-Bsymbolic"
   1103 // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtbegin_so.o"
   1104 // CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib"
   1105 // CHECK-ANDROID-SO-NOT: "gcc_s"
   1106 // CHECK-ANDROID-SO: "-lgcc"
   1107 // CHECK-ANDROID-SO: "-ldl"
   1108 // CHECK-ANDROID-SO-NOT: "gcc_s"
   1109 // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o"
   1110 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1111 // RUN:     --target=arm-linux-androideabi \
   1112 // RUN:     --gcc-toolchain="" \
   1113 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1114 // RUN:     -static \
   1115 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1116 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1117 // RUN:     --target=arm-linux-android \
   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=aarch64-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=arm64-linux-android \
   1129 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1130 // RUN:     -static \
   1131 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1132 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1133 // RUN:     --target=mipsel-linux-android \
   1134 // RUN:     --gcc-toolchain="" \
   1135 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1136 // RUN:     -static \
   1137 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1138 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1139 // RUN:     --target=mips64el-linux-android \
   1140 // RUN:     --gcc-toolchain="" \
   1141 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1142 // RUN:     -static \
   1143 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1144 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1145 // RUN:     --target=i686-linux-android \
   1146 // RUN:     --gcc-toolchain="" \
   1147 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1148 // RUN:     -static \
   1149 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1150 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1151 // RUN:     --target=x86_64-linux-android \
   1152 // RUN:     --gcc-toolchain="" \
   1153 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1154 // RUN:     -static \
   1155 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
   1156 // CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1157 // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtbegin_static.o"
   1158 // CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib"
   1159 // CHECK-ANDROID-STATIC-NOT: "gcc_s"
   1160 // CHECK-ANDROID-STATIC: "-lgcc"
   1161 // CHECK-ANDROID-STATIC-NOT: "-ldl"
   1162 // CHECK-ANDROID-STATIC-NOT: "gcc_s"
   1163 // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o"
   1164 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1165 // RUN:     --target=arm-linux-androideabi \
   1166 // RUN:     --gcc-toolchain="" \
   1167 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot  \
   1168 // RUN:     -pie \
   1169 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1170 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1171 // RUN:     --target=arm-linux-android \
   1172 // RUN:     --gcc-toolchain="" \
   1173 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1174 // RUN:     -pie \
   1175 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1176 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1177 // RUN:     --target=aarch64-linux-android \
   1178 // RUN:     --gcc-toolchain="" \
   1179 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot  \
   1180 // RUN:     -pie \
   1181 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1182 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1183 // RUN:     --target=arm64-linux-android \
   1184 // RUN:     --gcc-toolchain="" \
   1185 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot  \
   1186 // RUN:     -pie \
   1187 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1188 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1189 // RUN:     --target=mipsel-linux-android \
   1190 // RUN:     --gcc-toolchain="" \
   1191 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1192 // RUN:     -pie \
   1193 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1194 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1195 // RUN:     --target=mips64el-linux-android \
   1196 // RUN:     --gcc-toolchain="" \
   1197 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1198 // RUN:     -pie \
   1199 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1200 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1201 // RUN:     --target=i686-linux-android \
   1202 // RUN:     --gcc-toolchain="" \
   1203 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1204 // RUN:     -pie \
   1205 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1206 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1207 // RUN:     --target=x86_64-linux-android \
   1208 // RUN:     --gcc-toolchain="" \
   1209 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1210 // RUN:     -pie \
   1211 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
   1212 // CHECK-ANDROID-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1213 // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o"
   1214 // CHECK-ANDROID-PIE: "-L[[SYSROOT]]/usr/lib"
   1215 // CHECK-ANDROID-PIE-NOT: "gcc_s"
   1216 // CHECK-ANDROID-PIE: "-lgcc"
   1217 // CHECK-ANDROID-PIE-NOT: "gcc_s"
   1218 // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtend_android.o"
   1219 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1220 // RUN:     --target=arm-linux-androideabi \
   1221 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1222 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1223 // RUN:     --target=arm-linux-android \
   1224 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1225 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1226 // RUN:     --target=aarch64-linux-android \
   1227 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1228 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1229 // RUN:     --target=arm64-linux-android \
   1230 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1231 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1232 // RUN:     --target=mipsel-linux-android \
   1233 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1234 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1235 // RUN:     --target=mips64el-linux-android \
   1236 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1237 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1238 // RUN:     --target=i686-linux-android \
   1239 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1240 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1241 // RUN:     --target=x86_64-linux-android \
   1242 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NO-DEFAULT-PIE %s
   1243 // CHECK-ANDROID-NO-DEFAULT-PIE-NOT: -pie
   1244 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1245 // RUN:     --target=arm-linux-androideabi \
   1246 // RUN:     --gcc-toolchain="" \
   1247 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1248 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
   1249 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1250 // RUN:     --target=arm-linux-android \
   1251 // RUN:     --gcc-toolchain="" \
   1252 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1253 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
   1254 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1255 // RUN:     --target=mipsel-linux-android \
   1256 // RUN:     --gcc-toolchain="" \
   1257 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1258 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
   1259 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1260 // RUN:     --target=aarch64-linux-android \
   1261 // RUN:     --gcc-toolchain="" \
   1262 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1263 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
   1264 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1265 // RUN:     --target=arm64-linux-android \
   1266 // RUN:     --gcc-toolchain="" \
   1267 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1268 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
   1269 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1270 // RUN:     --target=mips64el-linux-android \
   1271 // RUN:     --gcc-toolchain="" \
   1272 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1273 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
   1274 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1275 // RUN:     --target=i686-linux-android \
   1276 // RUN:     --gcc-toolchain="" \
   1277 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1278 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
   1279 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1280 // RUN:     --target=x86_64-linux-android \
   1281 // RUN:     --gcc-toolchain="" \
   1282 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1283 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
   1284 // CHECK-ANDROID-32: "-dynamic-linker" "/system/bin/linker"
   1285 // CHECK-ANDROID-64: "-dynamic-linker" "/system/bin/linker64"
   1286 //
   1287 // Test that -pthread does not add -lpthread on Android.
   1288 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1289 // RUN:     --target=arm-linux-androideabi -pthread \
   1290 // RUN:     --gcc-toolchain="" \
   1291 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1292 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1293 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1294 // RUN:     --target=arm-linux-android -pthread \
   1295 // RUN:     --gcc-toolchain="" \
   1296 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1297 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1298 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1299 // RUN:     --target=aarch64-linux-android -pthread \
   1300 // RUN:     --gcc-toolchain="" \
   1301 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1302 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1303 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1304 // RUN:     --target=arm64-linux-android -pthread \
   1305 // RUN:     --gcc-toolchain="" \
   1306 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1307 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1308 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1309 // RUN:     --target=mipsel-linux-android -pthread \
   1310 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1311 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1312 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1313 // RUN:     --target=mips64el-linux-android -pthread \
   1314 // RUN:     --gcc-toolchain="" \
   1315 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1316 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1317 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1318 // RUN:     --target=i686-linux-android -pthread \
   1319 // RUN:     --gcc-toolchain="" \
   1320 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1321 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1322 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1323 // RUN:     --target=x86_64-linux-android -pthread \
   1324 // RUN:     --gcc-toolchain="" \
   1325 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1326 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1327 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1328 // RUN:     --target=arm-linux-androideabi -pthread \
   1329 // RUN:     --gcc-toolchain="" \
   1330 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1331 // RUN:     -shared \
   1332 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1333 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1334 // RUN:     --target=arm-linux-android -pthread \
   1335 // RUN:     --gcc-toolchain="" \
   1336 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1337 // RUN:     -shared \
   1338 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1339 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1340 // RUN:     --target=aarch64-linux-android -pthread \
   1341 // RUN:     --gcc-toolchain="" \
   1342 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1343 // RUN:     -shared \
   1344 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1345 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1346 // RUN:     --target=arm64-linux-android -pthread \
   1347 // RUN:     --gcc-toolchain="" \
   1348 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1349 // RUN:     -shared \
   1350 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1351 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1352 // RUN:     --target=mipsel-linux-android -pthread \
   1353 // RUN:     --gcc-toolchain="" \
   1354 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1355 // RUN:     -shared \
   1356 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1357 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1358 // RUN:     --target=mips64el-linux-android -pthread \
   1359 // RUN:     --gcc-toolchain="" \
   1360 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1361 // RUN:     -shared \
   1362 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1363 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1364 // RUN:     --target=i686-linux-android -pthread \
   1365 // RUN:     --gcc-toolchain="" \
   1366 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1367 // RUN:     -shared \
   1368 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1369 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1370 // RUN:     --target=x86_64-linux-android -pthread \
   1371 // RUN:     --gcc-toolchain="" \
   1372 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1373 // RUN:     -shared \
   1374 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
   1375 // CHECK-ANDROID-PTHREAD-NOT: -lpthread
   1376 //
   1377 // RUN: %clang -no-canonical-prefixes %t.o -### -o %t 2>&1 \
   1378 // RUN:     --target=arm-linux-androideabi -pthread \
   1379 // RUN:     --gcc-toolchain="" \
   1380 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
   1381 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD-LINK %s
   1382 // CHECK-ANDROID-PTHREAD-LINK-NOT: argument unused during compilation: '-pthread'
   1383 //
   1384 // Check linker invocation on Debian 6 MIPS 32/64-bit.
   1385 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1386 // RUN:     --target=mipsel-linux-gnu \
   1387 // RUN:     --gcc-toolchain="" \
   1388 // RUN:     --sysroot=%S/Inputs/debian_6_mips_tree \
   1389 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPSEL %s
   1390 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1391 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crt1.o"
   1392 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crti.o"
   1393 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4{{/|\\\\}}crtbegin.o"
   1394 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4"
   1395 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib"
   1396 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib/../lib"
   1397 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/../lib"
   1398 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.."
   1399 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib"
   1400 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib"
   1401 //
   1402 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1403 // RUN:     --target=mips64el-linux-gnu \
   1404 // RUN:     --gcc-toolchain="" \
   1405 // RUN:     --sysroot=%S/Inputs/debian_6_mips_tree \
   1406 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL %s
   1407 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1408 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crt1.o"
   1409 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crti.o"
   1410 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/64{{/|\\\\}}crtbegin.o"
   1411 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/64"
   1412 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64"
   1413 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib/../lib64"
   1414 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/../lib64"
   1415 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.."
   1416 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib"
   1417 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
   1418 //
   1419 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1420 // RUN:     --target=mips64el-linux-gnu -mabi=n32 \
   1421 // RUN:     --gcc-toolchain="" \
   1422 // RUN:     --sysroot=%S/Inputs/debian_6_mips_tree \
   1423 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-N32 %s
   1424 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1425 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crt1.o"
   1426 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crti.o"
   1427 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/n32{{/|\\\\}}crtbegin.o"
   1428 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/n32"
   1429 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32"
   1430 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib/../lib32"
   1431 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/../lib32"
   1432 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.."
   1433 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib"
   1434 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib"
   1435 //
   1436 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1437 // RUN:     --target=mips64-linux-gnuabi64 -mabi=n64 \
   1438 // RUN:     --gcc-toolchain="" \
   1439 // RUN:     --sysroot=%S/Inputs/debian_6_mips64_tree \
   1440 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64-GNUABI %s
   1441 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1442 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crt1.o"
   1443 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crti.o"
   1444 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtbegin.o"
   1445 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9"
   1446 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64"
   1447 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/lib/mips64-linux-gnuabi64"
   1448 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/mips64-linux-gnuabi64"
   1449 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9"
   1450 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../.."
   1451 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/lib"
   1452 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib"
   1453 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtend.o"
   1454 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crtn.o"
   1455 //
   1456 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1457 // RUN:     --target=mips64el-linux-gnuabi64 -mabi=n64 \
   1458 // RUN:     --gcc-toolchain="" \
   1459 // RUN:     --sysroot=%S/Inputs/debian_6_mips64_tree \
   1460 // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-GNUABI %s
   1461 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1462 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crt1.o"
   1463 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crti.o"
   1464 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9{{/|\\\\}}crtbegin.o"
   1465 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9"
   1466 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64"
   1467 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/lib/mips64el-linux-gnuabi64"
   1468 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/mips64el-linux-gnuabi64"
   1469 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9"
   1470 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../.."
   1471 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/lib"
   1472 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib"
   1473 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9{{/|\\\\}}crtend.o"
   1474 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crtn.o"
   1475 //
   1476 // Test linker invocation for Freescale SDK (OpenEmbedded).
   1477 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1478 // RUN:     --target=powerpc-fsl-linux \
   1479 // RUN:     --gcc-toolchain="" \
   1480 // RUN:     --sysroot=%S/Inputs/freescale_ppc_tree \
   1481 // RUN:   | FileCheck --check-prefix=CHECK-FSL-PPC %s
   1482 // CHECK-FSL-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1483 // CHECK-FSL-PPC: "-m" "elf32ppclinux"
   1484 // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crt1.o"
   1485 // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crtbegin.o"
   1486 // CHECK-FSL-PPC: "-L[[SYSROOT]]/usr/lib"
   1487 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1488 // RUN:     --target=powerpc64-fsl-linux \
   1489 // RUN:     --gcc-toolchain="" \
   1490 // RUN:     --sysroot=%S/Inputs/freescale_ppc64_tree \
   1491 // RUN:   | FileCheck --check-prefix=CHECK-FSL-PPC64 %s
   1492 // CHECK-FSL-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1493 // CHECK-FSL-PPC64: "-m" "elf64ppc"
   1494 // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crt1.o"
   1495 // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crtbegin.o"
   1496 // CHECK-FSL-PPC64: "-L[[SYSROOT]]/usr/lib64/powerpc64-fsl-linux/4.6.2/../.."
   1497 //
   1498 // Check that crtfastmath.o is linked with -ffast-math and with -Ofast.
   1499 // RUN: %clang --target=x86_64-unknown-linux -### %s \
   1500 // RUN:        --gcc-toolchain="" \
   1501 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1502 // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
   1503 // RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math \
   1504 // RUN:        --gcc-toolchain="" \
   1505 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1506 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1507 // RUN: %clang --target=x86_64-unknown-linux -### %s -funsafe-math-optimizations\
   1508 // RUN:        --gcc-toolchain="" \
   1509 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1510 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1511 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast\
   1512 // RUN:        --gcc-toolchain="" \
   1513 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1514 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1515 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -O3\
   1516 // RUN:        --gcc-toolchain="" \
   1517 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1518 // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
   1519 // RUN: %clang --target=x86_64-unknown-linux -### %s -O3 -Ofast\
   1520 // RUN:        --gcc-toolchain="" \
   1521 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1522 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1523 // RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -fno-fast-math \
   1524 // RUN:        --gcc-toolchain="" \
   1525 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1526 // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
   1527 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-fast-math \
   1528 // RUN:        --gcc-toolchain="" \
   1529 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1530 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1531 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-unsafe-math-optimizations \
   1532 // RUN:        --gcc-toolchain="" \
   1533 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1534 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1535 // RUN: %clang --target=x86_64-unknown-linux -### %s -fno-fast-math -Ofast  \
   1536 // RUN:        --gcc-toolchain="" \
   1537 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1538 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1539 // RUN: %clang --target=x86_64-unknown-linux -### %s -fno-unsafe-math-optimizations -Ofast \
   1540 // RUN:        --gcc-toolchain="" \
   1541 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1542 // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
   1543 // We don't have crtfastmath.o in the i386 tree, use it to check that file
   1544 // detection works.
   1545 // RUN: %clang --target=i386-unknown-linux -### %s -ffast-math \
   1546 // RUN:        --gcc-toolchain="" \
   1547 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
   1548 // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
   1549 // CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtfastmath.o
   1550 // CHECK-NOCRTFASTMATH-NOT: crtfastmath.o
   1551 
   1552 // Check that we link in gcrt1.o when compiling with -pg
   1553 // RUN: %clang -pg --target=x86_64-unknown-linux -### %s \
   1554 // RUN:        --gcc-toolchain="" \
   1555 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
   1556 // RUN:   | FileCheck --check-prefix=CHECK-PG %s
   1557 // CHECK-PG: gcrt1.o
   1558 
   1559 // GCC forwards -u to the linker.
   1560 // RUN: %clang -u asdf --target=x86_64-unknown-linux -### %s \
   1561 // RUN:        --gcc-toolchain="" \
   1562 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
   1563 // RUN:   | FileCheck --check-prefix=CHECK-u %s
   1564 // CHECK-u: "-u" "asdf"
   1565 
   1566 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1567 // RUN:     --target=armeb-unknown-linux \
   1568 // RUN:     --gcc-toolchain="" \
   1569 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
   1570 // RUN:   | FileCheck --check-prefix=CHECK-ARMEB %s
   1571 // CHECK-ARMEB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1572 // CHECK-ARMEB-NOT: "--be8"
   1573 // CHECK-ARMEB: "-m" "armelfb_linux_eabi"
   1574 
   1575 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
   1576 // RUN:     --target=armebv7-unknown-linux \
   1577 // RUN:     --gcc-toolchain="" \
   1578 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
   1579 // RUN:   | FileCheck --check-prefix=CHECK-ARMV7EB %s
   1580 // CHECK-ARMV7EB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
   1581 // CHECK-ARMV7EB: "--be8"
   1582 // CHECK-ARMV7EB: "-m" "armelfb_linux_eabi"
   1583 
   1584 // Check dynamic-linker for musl-libc
   1585 // RUN: %clang %s -### -o %t.o 2>&1 \
   1586 // RUN:     --target=i386-pc-linux-musl \
   1587 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-X86 %s
   1588 // RUN: %clang %s -### -o %t.o 2>&1 \
   1589 // RUN:     --target=x86_64-pc-linux-musl \
   1590 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-X86_64 %s
   1591 // RUN: %clang %s -### -o %t.o 2>&1 \
   1592 // RUN:     --target=mips-pc-linux-musl \
   1593 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-MIPS %s
   1594 // RUN: %clang %s -### -o %t.o 2>&1 \
   1595 // RUN:     --target=mipsel-pc-linux-musl \
   1596 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-MIPSEL %s
   1597 // RUN: %clang %s -### -o %t.o 2>&1 \
   1598 // RUN:     --target=mips64-pc-linux-musl \
   1599 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-MIPS64 %s
   1600 // RUN: %clang %s -### -o %t.o 2>&1 \
   1601 // RUN:     --target=mips64el-pc-linux-musl \
   1602 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-MIPS64EL %s
   1603 // RUN: %clang %s -### -o %t.o 2>&1 \
   1604 // RUN:     --target=powerpc-pc-linux-musl \
   1605 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-PPC %s
   1606 // RUN: %clang %s -### -o %t.o 2>&1 \
   1607 // RUN:     --target=powerpc64-pc-linux-musl \
   1608 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-PPC64 %s
   1609 // RUN: %clang %s -### -o %t.o 2>&1 \
   1610 // RUN:     --target=thumb-pc-linux-musleabi \
   1611 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-ARM %s
   1612 // RUN: %clang %s -### -o %t.o 2>&1 \
   1613 // RUN:     --target=thumb-pc-linux-musleabihf \
   1614 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-ARMHF %s
   1615 // RUN: %clang %s -### -o %t.o 2>&1 \
   1616 // RUN:     --target=thumbeb-pc-linux-musleabi \
   1617 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-ARMEB %s
   1618 // RUN: %clang %s -### -o %t.o 2>&1 \
   1619 // RUN:     --target=thumbeb-pc-linux-musleabihf \
   1620 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-ARMEBHF %s
   1621 // RUN: %clang %s -### -o %t.o 2>&1 \
   1622 // RUN:     --target=arm-pc-linux-musleabi \
   1623 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-ARM %s
   1624 // RUN: %clang %s -### -o %t.o 2>&1 \
   1625 // RUN:     --target=arm-pc-linux-musleabihf \
   1626 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-ARMHF %s
   1627 // RUN: %clang %s -### -o %t.o 2>&1 \
   1628 // RUN:     --target=armeb-pc-linux-musleabi \
   1629 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-ARMEB %s
   1630 // RUN: %clang %s -### -o %t.o 2>&1 \
   1631 // RUN:     --target=armeb-pc-linux-musleabihf \
   1632 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-ARMEBHF %s
   1633 // RUN: %clang %s -### -o %t.o 2>&1 \
   1634 // RUN:     --target=aarch64-pc-linux-musleabi \
   1635 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-AARCH64 %s
   1636 // RUN: %clang %s -### -o %t.o 2>&1 \
   1637 // RUN:     --target=aarch64_be-pc-linux-musleabi \
   1638 // RUN:   | FileCheck --check-prefix=CHECK-MUSL-AARCH64_BE %s
   1639 // CHECK-MUSL-X86:        "-dynamic-linker" "/lib/ld-musl-i386.so.1"
   1640 // CHECK-MUSL-X86_64:     "-dynamic-linker" "/lib/ld-musl-x86_64.so.1"
   1641 // CHECK-MUSL-MIPS:       "-dynamic-linker" "/lib/ld-musl-mips.so.1"
   1642 // CHECK-MUSL-MIPSEL:     "-dynamic-linker" "/lib/ld-musl-mipsel.so.1"
   1643 // CHECK-MUSL-MIPS64:     "-dynamic-linker" "/lib/ld-musl-mips64.so.1"
   1644 // CHECK-MUSL-MIPS64EL:   "-dynamic-linker" "/lib/ld-musl-mips64el.so.1"
   1645 // CHECK-MUSL-PPC:        "-dynamic-linker" "/lib/ld-musl-powerpc.so.1"
   1646 // CHECK-MUSL-PPC64:      "-dynamic-linker" "/lib/ld-musl-powerpc64.so.1"
   1647 // CHECK-MUSL-ARM:        "-dynamic-linker" "/lib/ld-musl-arm.so.1"
   1648 // CHECK-MUSL-ARMHF:      "-dynamic-linker" "/lib/ld-musl-armhf.so.1"
   1649 // CHECK-MUSL-ARMEB:      "-dynamic-linker" "/lib/ld-musl-armeb.so.1"
   1650 // CHECK-MUSL-ARMEBHF:    "-dynamic-linker" "/lib/ld-musl-armebhf.so.1"
   1651 // CHECK-MUSL-AARCH64:    "-dynamic-linker" "/lib/ld-musl-aarch64.so.1"
   1652 // CHECK-MUSL-AARCH64_BE: "-dynamic-linker" "/lib/ld-musl-aarch64_be.so.1"
   1653