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: --sysroot=%S/Inputs/basic_linux_tree \ 7 // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s 8 // CHECK-LD-32-NOT: warning: 9 // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 10 // CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 11 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" 12 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" 13 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." 14 // CHECK-LD-32: "-L[[SYSROOT]]/lib" 15 // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib" 16 // 17 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 18 // RUN: --target=x86_64-unknown-linux \ 19 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 20 // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s 21 // CHECK-LD-64-NOT: warning: 22 // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 23 // CHECK-LD-64: "--eh-frame-hdr" 24 // CHECK-LD-64: "-m" "elf_x86_64" 25 // CHECK-LD-64: "-dynamic-linker" 26 // CHECK-LD-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 27 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 28 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 29 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 30 // CHECK-LD-64: "-L[[SYSROOT]]/lib" 31 // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib" 32 // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" 33 // CHECK-LD-64: "-lc" 34 // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" 35 // 36 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 37 // RUN: --target=x86_64-unknown-linux-gnux32 \ 38 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 39 // RUN: | FileCheck --check-prefix=CHECK-LD-X32 %s 40 // CHECK-LD-X32-NOT: warning: 41 // CHECK-LD-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 42 // CHECK-LD-X32: "--eh-frame-hdr" 43 // CHECK-LD-X32: "-m" "elf32_x86_64" 44 // CHECK-LD-X32: "-dynamic-linker" 45 // CHECK-LD-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" 46 // CHECK-LD-X32: "-lc" 47 // CHECK-LD-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" 48 // 49 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 50 // RUN: --target=x86_64-unknown-linux \ 51 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 52 // RUN: --rtlib=compiler-rt \ 53 // RUN: | FileCheck --check-prefix=CHECK-LD-RT %s 54 // CHECK-LD-RT-NOT: warning: 55 // CHECK-LD-RT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 56 // CHECK-LD-RT: "--eh-frame-hdr" 57 // CHECK-LD-RT: "-m" "elf_x86_64" 58 // CHECK-LD-RT: "-dynamic-linker" 59 // CHECK-LD-RT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 60 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 61 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 62 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 63 // CHECK-LD-RT: "-L[[SYSROOT]]/lib" 64 // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib" 65 // CHECK-LD-RT: libclang_rt.builtins-x86_64.a" "-lgcc_s" 66 // CHECK-LD-RT: "-lc" 67 // CHECK-LD-RT: libclang_rt.builtins-x86_64.a" "-lgcc_s" 68 // 69 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 70 // RUN: --target=x86_64-unknown-linux \ 71 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 72 // RUN: --rtlib=libgcc \ 73 // RUN: | FileCheck --check-prefix=CHECK-LD-GCC %s 74 // CHECK-LD-GCC-NOT: warning: 75 // CHECK-LD-GCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 76 // CHECK-LD-GCC: "--eh-frame-hdr" 77 // CHECK-LD-GCC: "-m" "elf_x86_64" 78 // CHECK-LD-GCC: "-dynamic-linker" 79 // CHECK-LD-GCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 80 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 81 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 82 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 83 // CHECK-LD-GCC: "-L[[SYSROOT]]/lib" 84 // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib" 85 // CHECK-LD-GCC "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" 86 // CHECK-LD-GCC: "-lc" 87 // CHECK-LD-GCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" 88 // 89 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 90 // RUN: --target=x86_64-unknown-linux \ 91 // RUN: -static-libgcc \ 92 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 93 // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC-LIBGCC %s 94 // CHECK-LD-64-STATIC-LIBGCC-NOT: warning: 95 // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 96 // CHECK-LD-64-STATIC-LIBGCC: "--eh-frame-hdr" 97 // CHECK-LD-64-STATIC-LIBGCC: "-m" "elf_x86_64" 98 // CHECK-LD-64-STATIC-LIBGCC: "-dynamic-linker" 99 // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 100 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 101 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 102 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 103 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/lib" 104 // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib" 105 // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" 106 // CHECK-LD-64-STATIC-LIBGCC: "-lc" 107 // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh" 108 // 109 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 110 // RUN: --target=x86_64-unknown-linux \ 111 // RUN: -static \ 112 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 113 // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s 114 // CHECK-LD-64-STATIC-NOT: warning: 115 // CHECK-LD-64-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 116 // CHECK-LD-64-STATIC-NOT: "--eh-frame-hdr" 117 // CHECK-LD-64-STATIC: "-m" "elf_x86_64" 118 // CHECK-LD-64-STATIC-NOT: "-dynamic-linker" 119 // CHECK-LD-64-STATIC: "-static" 120 // CHECK-LD-64-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbeginT.o" 121 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 122 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 123 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 124 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/lib" 125 // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib" 126 // CHECK-LD-64-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group" 127 // 128 // Check that flags can be combined. The -static dominates. 129 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 130 // RUN: --target=x86_64-unknown-linux \ 131 // RUN: -static-libgcc -static \ 132 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 133 // RUN: | FileCheck --check-prefix=CHECK-LD-64-STATIC %s 134 // 135 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 136 // RUN: --target=i386-unknown-linux -m32 \ 137 // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \ 138 // RUN: | FileCheck --check-prefix=CHECK-32-TO-32 %s 139 // CHECK-32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 140 // CHECK-32-TO-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 141 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" 142 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib32" 143 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib32" 144 // CHECK-32-TO-32: "-L[[SYSROOT]]/lib/../lib32" 145 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32" 146 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" 147 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." 148 // CHECK-32-TO-32: "-L[[SYSROOT]]/lib" 149 // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib" 150 // 151 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 152 // RUN: --target=i386-unknown-linux -m64 \ 153 // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \ 154 // RUN: | FileCheck --check-prefix=CHECK-32-TO-64 %s 155 // CHECK-32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 156 // CHECK-32-TO-64: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/64{{/|\\\\}}crtbegin.o" 157 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/64" 158 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib64" 159 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib64" 160 // CHECK-32-TO-64: "-L[[SYSROOT]]/lib/../lib64" 161 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64" 162 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0" 163 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib" 164 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.." 165 // CHECK-32-TO-64: "-L[[SYSROOT]]/lib" 166 // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib" 167 // 168 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 169 // RUN: --target=x86_64-unknown-linux -m64 \ 170 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \ 171 // RUN: | FileCheck --check-prefix=CHECK-64-TO-64 %s 172 // CHECK-64-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 173 // CHECK-64-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 174 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 175 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib64" 176 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib64" 177 // CHECK-64-TO-64: "-L[[SYSROOT]]/lib/../lib64" 178 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64" 179 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 180 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 181 // CHECK-64-TO-64: "-L[[SYSROOT]]/lib" 182 // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib" 183 // 184 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 185 // RUN: --target=x86_64-unknown-linux -m32 \ 186 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \ 187 // RUN: | FileCheck --check-prefix=CHECK-64-TO-32 %s 188 // CHECK-64-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 189 // CHECK-64-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o" 190 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32" 191 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib32" 192 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib32" 193 // CHECK-64-TO-32: "-L[[SYSROOT]]/lib/../lib32" 194 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32" 195 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 196 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 197 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 198 // CHECK-64-TO-32: "-L[[SYSROOT]]/lib" 199 // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib" 200 // 201 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 202 // RUN: --target=x86_64-unknown-linux-gnux32 \ 203 // RUN: --sysroot=%S/Inputs/multilib_64bit_linux_tree \ 204 // RUN: | FileCheck --check-prefix=CHECK-X32 %s 205 // CHECK-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 206 // CHECK-X32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32{{/|\\\\}}crtbegin.o" 207 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32" 208 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../libx32" 209 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../libx32" 210 // CHECK-X32: "-L[[SYSROOT]]/lib/../libx32" 211 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/../libx32" 212 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 213 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib" 214 // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.." 215 // CHECK-X32: "-L[[SYSROOT]]/lib" 216 // CHECK-X32: "-L[[SYSROOT]]/usr/lib" 217 // 218 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 219 // RUN: --target=x86_64-unknown-linux -m32 \ 220 // RUN: --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \ 221 // RUN: --sysroot=%S/Inputs/multilib_32bit_linux_tree \ 222 // RUN: | FileCheck --check-prefix=CHECK-64-TO-32-SYSROOT %s 223 // CHECK-64-TO-32-SYSROOT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 224 // CHECK-64-TO-32-SYSROOT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o" 225 // CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32" 226 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib/../lib32" 227 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib/../lib32" 228 // CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 229 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib" 230 // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib" 231 // 232 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 233 // RUN: --target=i386-unknown-linux -m32 \ 234 // RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \ 235 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 236 // RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-32 %s 237 // CHECK-INSTALL-DIR-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 238 // CHECK-INSTALL-DIR-32: "{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0{{/|\\\\}}crtbegin.o" 239 // CHECK-INSTALL-DIR-32: "-L{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0" 240 // 241 // Check that with 64-bit builds, we don't actually use the install directory 242 // as its version of GCC is lower than our sysrooted version. 243 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 244 // RUN: --target=x86_64-unknown-linux -m64 \ 245 // RUN: -ccc-install-dir %S/Inputs/fake_install_tree/bin \ 246 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 247 // RUN: | FileCheck --check-prefix=CHECK-INSTALL-DIR-64 %s 248 // CHECK-INSTALL-DIR-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 249 // CHECK-INSTALL-DIR-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" 250 // CHECK-INSTALL-DIR-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0" 251 // 252 // Check that we support unusual patch version formats, including missing that 253 // component. 254 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 255 // RUN: --target=i386-unknown-linux -m32 \ 256 // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing1/bin \ 257 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 258 // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION1 %s 259 // CHECK-GCC-VERSION1: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 260 // CHECK-GCC-VERSION1: "{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7{{/|\\\\}}crtbegin.o" 261 // CHECK-GCC-VERSION1: "-L{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7" 262 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 263 // RUN: --target=i386-unknown-linux -m32 \ 264 // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing2/bin \ 265 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 266 // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION2 %s 267 // CHECK-GCC-VERSION2: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 268 // CHECK-GCC-VERSION2: "{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x{{/|\\\\}}crtbegin.o" 269 // CHECK-GCC-VERSION2: "-L{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x" 270 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 271 // RUN: --target=i386-unknown-linux -m32 \ 272 // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing3/bin \ 273 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 274 // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION3 %s 275 // CHECK-GCC-VERSION3: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 276 // CHECK-GCC-VERSION3: "{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5{{/|\\\\}}crtbegin.o" 277 // CHECK-GCC-VERSION3: "-L{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5" 278 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 279 // RUN: --target=i386-unknown-linux -m32 \ 280 // RUN: -ccc-install-dir %S/Inputs/gcc_version_parsing4/bin \ 281 // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 282 // RUN: | FileCheck --check-prefix=CHECK-GCC-VERSION4 %s 283 // CHECK-GCC-VERSION4: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 284 // CHECK-GCC-VERSION4: "{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99{{/|\\\\}}crtbegin.o" 285 // CHECK-GCC-VERSION4: "-L{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99" 286 // 287 // Test a simulated installation of libc++ on Linux, both through sysroot and 288 // the installation path of Clang. 289 // RUN: %clangxx -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \ 290 // RUN: -target x86_64-unknown-linux-gnu \ 291 // RUN: -stdlib=libc++ \ 292 // RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \ 293 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \ 294 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-SYSROOT %s 295 // CHECK-BASIC-LIBCXX-SYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1" 296 // CHECK-BASIC-LIBCXX-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]" 297 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1" 298 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include" 299 // CHECK-BASIC-LIBCXX-SYSROOT: "--sysroot=[[SYSROOT]]" 300 // RUN: %clang -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \ 301 // RUN: -target x86_64-unknown-linux-gnu \ 302 // RUN: -stdlib=libc++ \ 303 // RUN: -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \ 304 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \ 305 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-INSTALL %s 306 // CHECK-BASIC-LIBCXX-INSTALL: "{{[^"]*}}clang{{[^"]*}}" "-cc1" 307 // CHECK-BASIC-LIBCXX-INSTALL: "-isysroot" "[[SYSROOT:[^"]+]]" 308 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1" 309 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/local/include" 310 // CHECK-BASIC-LIBCXX-INSTALL: "--sysroot=[[SYSROOT]]" 311 // CHECK-BASIC-LIBCXX-INSTALL: "-L[[SYSROOT]]/usr/bin/../lib" 312 // 313 // Test a very broken version of multiarch that shipped in Ubuntu 11.04. 314 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 315 // RUN: --target=i386-unknown-linux \ 316 // RUN: --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \ 317 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s 318 // CHECK-UBUNTU-11-04: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 319 // CHECK-UBUNTU-11-04: "{{.*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 320 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5" 321 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../i386-linux-gnu" 322 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu" 323 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.." 324 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/lib" 325 // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib" 326 // 327 // Check multi arch support on Ubuntu 12.04 LTS. 328 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 329 // RUN: --target=arm-unknown-linux-gnueabihf \ 330 // RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \ 331 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM-HF %s 332 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 333 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crt1.o" 334 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crti.o" 335 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtbegin.o" 336 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3" 337 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf" 338 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/lib/arm-linux-gnueabihf" 339 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabihf" 340 // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../.." 341 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtend.o" 342 // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crtn.o" 343 // 344 // Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabihf. 345 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 346 // RUN: --target=arm-linux-gnueabihf \ 347 // RUN: --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \ 348 // RUN: | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM-HF %s 349 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 350 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-dynamic-linker" "/lib/ld-linux-armhf.so.3" 351 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crt1.o" 352 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crti.o" 353 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtbegin.o" 354 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8" 355 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib" 356 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/lib/../lib" 357 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/../lib" 358 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib" 359 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtend.o" 360 // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crtn.o" 361 // 362 // Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabi. 363 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 364 // RUN: --target=arm-linux-gnueabi \ 365 // RUN: --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \ 366 // RUN: | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM %s 367 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 368 // CHECK-X86-64-UBUNTU-13-10-ARM: "-dynamic-linker" "/lib/ld-linux.so.3" 369 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crt1.o" 370 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crti.o" 371 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtbegin.o" 372 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7" 373 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib" 374 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/lib/../lib" 375 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/../lib" 376 // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib" 377 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtend.o" 378 // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crtn.o" 379 // 380 // Check Ubuntu 14.04 on powerpc64le. 381 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 382 // RUN: --target=powerpc64le-unknown-linux-gnu \ 383 // RUN: --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \ 384 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-14-04-PPC64LE %s 385 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 386 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crt1.o" 387 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crti.o" 388 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8{{/|\\\\}}crtbegin.o" 389 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8" 390 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu" 391 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/lib/powerpc64le-linux-gnu" 392 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/powerpc64le-linux-gnu" 393 // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../.." 394 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8{{/|\\\\}}crtend.o" 395 // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crtn.o" 396 // 397 // Check Ubuntu 14.04 on x32. 398 // "/usr/lib/gcc/x86_64-linux-gnu/4.8/x32/crtend.o" "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32/crtn.o" 399 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 400 // RUN: --target=x86_64-unknown-linux-gnux32 \ 401 // RUN: --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \ 402 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-14-04-X32 %s 403 // CHECK-UBUNTU-14-04-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 404 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crt1.o" 405 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crti.o" 406 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/x32{{/|\\\\}}crtbegin.o" 407 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/x32" 408 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32" 409 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/lib/../libx32" 410 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/../libx32" 411 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu/../../libx32" 412 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8" 413 // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.." 414 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/x32{{/|\\\\}}crtend.o" 415 // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crtn.o" 416 // 417 // Check fedora 18 on arm. 418 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 419 // RUN: --target=armv7-unknown-linux-gnueabihf \ 420 // RUN: --sysroot=%S/Inputs/fedora_18_tree \ 421 // RUN: | FileCheck --check-prefix=CHECK-FEDORA-18-ARM-HF %s 422 // CHECK-FEDORA-18-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 423 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crt1.o" 424 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crti.o" 425 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtbegin.o" 426 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2" 427 // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib" 428 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtend.o" 429 // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crtn.o" 430 // 431 // Check Fedora 21 on AArch64. 432 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 433 // RUN: --target=arm64-unknown-linux-gnu \ 434 // RUN: --sysroot=%S/Inputs/fedora_21_tree \ 435 // RUN: | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s 436 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 437 // RUN: --target=aarch64-unknown-linux-gnu \ 438 // RUN: --sysroot=%S/Inputs/fedora_21_tree \ 439 // RUN: | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s 440 // CHECK-FEDORA-21-AARCH64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 441 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crt1.o" 442 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crti.o" 443 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|\\\\}}crtbegin.o" 444 // CHECK-FEDORA-21-AARCH64: "-L[[SYSROOT]]/usr/lib/gcc/aarch64-redhat-linux/4.9.0" 445 // CHECK-FEDORA-21-AARCH64: "-L[[SYSROOT]]/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64" 446 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|\\\\}}crtend.o" 447 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crtn.o" 448 // 449 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 450 // RUN: --target=arm-unknown-linux-gnueabi \ 451 // RUN: --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \ 452 // RUN: | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM %s 453 // CHECK-UBUNTU-12-04-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 454 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crt1.o" 455 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crti.o" 456 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtbegin.o" 457 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1" 458 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi" 459 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/lib/arm-linux-gnueabi" 460 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabi" 461 // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../.." 462 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtend.o" 463 // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crtn.o" 464 // 465 // Test the setup that shipped in SUSE 10.3 on ppc64. 466 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 467 // RUN: --target=powerpc64-suse-linux \ 468 // RUN: --sysroot=%S/Inputs/suse_10.3_ppc64_tree \ 469 // RUN: | FileCheck --check-prefix=CHECK-SUSE-10-3-PPC64 %s 470 // CHECK-SUSE-10-3-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 471 // CHECK-SUSE-10-3-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64{{/|\\\\}}crtbegin.o" 472 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64" 473 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib64" 474 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/lib/../lib64" 475 // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/../lib64" 476 // 477 // Check dynamic-linker for different archs 478 // RUN: %clang %s -### -o %t.o 2>&1 \ 479 // RUN: --target=arm-linux-gnueabi \ 480 // RUN: | FileCheck --check-prefix=CHECK-ARM %s 481 // CHECK-ARM: "{{.*}}ld{{(.exe)?}}" 482 // CHECK-ARM: "-m" "armelf_linux_eabi" 483 // CHECK-ARM: "-dynamic-linker" "{{.*}}/lib/ld-linux.so.3" 484 // 485 // RUN: %clang %s -### -o %t.o 2>&1 \ 486 // RUN: --target=arm-linux-gnueabihf \ 487 // RUN: | FileCheck --check-prefix=CHECK-ARM-HF %s 488 // CHECK-ARM-HF: "{{.*}}ld{{(.exe)?}}" 489 // CHECK-ARM-HF: "-m" "armelf_linux_eabi" 490 // CHECK-ARM-HF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3" 491 // 492 // RUN: %clang %s -### -o %t.o 2>&1 \ 493 // RUN: --target=powerpc64le-linux-gnu \ 494 // RUN: | FileCheck --check-prefix=CHECK-PPC64LE %s 495 // CHECK-PPC64LE: "{{.*}}ld{{(.exe)?}}" 496 // CHECK-PPC64LE: "-m" "elf64lppc" 497 // CHECK-PPC64LE: "-dynamic-linker" "{{.*}}/lib64/ld64.so.2" 498 // 499 // Check that we do not pass --hash-style=gnu and --hash-style=both to linker 500 // and provide correct path to the dynamic linker and emulation mode when build 501 // for MIPS platforms. 502 // RUN: %clang %s -### -o %t.o 2>&1 \ 503 // RUN: --target=mips-linux-gnu \ 504 // RUN: | FileCheck --check-prefix=CHECK-MIPS %s 505 // CHECK-MIPS: "{{.*}}ld{{(.exe)?}}" 506 // CHECK-MIPS: "-m" "elf32btsmip" 507 // CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1" 508 // CHECK-MIPS-NOT: "--hash-style={{gnu|both}}" 509 // 510 // RUN: %clang %s -### -o %t.o 2>&1 \ 511 // RUN: --target=mipsel-linux-gnu \ 512 // RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s 513 // CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}" 514 // CHECK-MIPSEL: "-m" "elf32ltsmip" 515 // CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib/ld.so.1" 516 // CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}" 517 // 518 // RUN: %clang %s -### -o %t.o 2>&1 --target=mipsel-linux-gnu -mnan=2008 \ 519 // RUN: | FileCheck --check-prefix=CHECK-MIPSEL-NAN2008 %s 520 // CHECK-MIPSEL-NAN2008: "{{.*}}ld{{(.exe)?}}" 521 // CHECK-MIPSEL-NAN2008: "-m" "elf32ltsmip" 522 // CHECK-MIPSEL-NAN2008: "-dynamic-linker" "{{.*}}/lib/ld-linux-mipsn8.so.1" 523 // CHECK-MIPSEL-NAN2008-NOT: "--hash-style={{gnu|both}}" 524 // 525 // RUN: %clang %s -### -o %t.o 2>&1 --target=mipsel-linux-gnu -mcpu=mips32r6 \ 526 // RUN: | FileCheck --check-prefix=CHECK-MIPS32R6EL %s 527 // CHECK-MIPS32R6EL: "{{.*}}ld{{(.exe)?}}" 528 // CHECK-MIPS32R6EL: "-m" "elf32ltsmip" 529 // CHECK-MIPS32R6EL: "-dynamic-linker" "{{.*}}/lib/ld-linux-mipsn8.so.1" 530 // CHECK-MIPS32R6EL-NOT: "--hash-style={{gnu|both}}" 531 // 532 // RUN: %clang %s -### -o %t.o 2>&1 \ 533 // RUN: --target=mips64-linux-gnu \ 534 // RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s 535 // CHECK-MIPS64: "{{.*}}ld{{(.exe)?}}" 536 // CHECK-MIPS64: "-m" "elf64btsmip" 537 // CHECK-MIPS64: "-dynamic-linker" "{{.*}}/lib64/ld.so.1" 538 // CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}" 539 // 540 // RUN: %clang %s -### -o %t.o 2>&1 \ 541 // RUN: --target=mips64el-linux-gnu \ 542 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s 543 // CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}" 544 // CHECK-MIPS64EL: "-m" "elf64ltsmip" 545 // CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/lib64/ld.so.1" 546 // CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}" 547 // 548 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mnan=2008 \ 549 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-NAN2008 %s 550 // CHECK-MIPS64EL-NAN2008: "{{.*}}ld{{(.exe)?}}" 551 // CHECK-MIPS64EL-NAN2008: "-m" "elf64ltsmip" 552 // CHECK-MIPS64EL-NAN2008: "-dynamic-linker" "{{.*}}/lib64/ld-linux-mipsn8.so.1" 553 // CHECK-MIPS64EL-NAN2008-NOT: "--hash-style={{gnu|both}}" 554 // 555 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mcpu=mips64r6 \ 556 // RUN: | FileCheck --check-prefix=CHECK-MIPS64R6EL %s 557 // CHECK-MIPS64R6EL: "{{.*}}ld{{(.exe)?}}" 558 // CHECK-MIPS64R6EL: "-m" "elf64ltsmip" 559 // CHECK-MIPS64R6EL: "-dynamic-linker" "{{.*}}/lib64/ld-linux-mipsn8.so.1" 560 // CHECK-MIPS64R6EL-NOT: "--hash-style={{gnu|both}}" 561 // 562 // RUN: %clang %s -### -o %t.o 2>&1 \ 563 // RUN: --target=mips64-linux-gnu -mabi=n32 \ 564 // RUN: | FileCheck --check-prefix=CHECK-MIPS64-N32 %s 565 // CHECK-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" 566 // CHECK-MIPS64-N32: "-m" "elf32btsmipn32" 567 // CHECK-MIPS64-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1" 568 // CHECK-MIPS64-N32-NOT: "--hash-style={{gnu|both}}" 569 // 570 // RUN: %clang %s -### -o %t.o 2>&1 \ 571 // RUN: --target=mips64el-linux-gnu -mabi=n32 \ 572 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-N32 %s 573 // CHECK-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" 574 // CHECK-MIPS64EL-N32: "-m" "elf32ltsmipn32" 575 // CHECK-MIPS64EL-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1" 576 // CHECK-MIPS64EL-N32-NOT: "--hash-style={{gnu|both}}" 577 // 578 // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mabi=n32 \ 579 // RUN: -mnan=2008 | FileCheck --check-prefix=CHECK-MIPS64EL-N32-NAN2008 %s 580 // CHECK-MIPS64EL-N32-NAN2008: "{{.*}}ld{{(.exe)?}}" 581 // CHECK-MIPS64EL-N32-NAN2008: "-m" "elf32ltsmipn32" 582 // CHECK-MIPS64EL-N32-NAN2008: "-dynamic-linker" "{{.*}}/lib32/ld-linux-mipsn8.so.1" 583 // CHECK-MIPS64EL-N32-NAN2008-NOT: "--hash-style={{gnu|both}}" 584 // 585 // RUN: %clang %s -### -o %t.o 2>&1 \ 586 // RUN: --target=sparc-linux-gnu \ 587 // RUN: | FileCheck --check-prefix=CHECK-SPARCV8 %s 588 // CHECK-SPARCV8: "{{.*}}ld{{(.exe)?}}" 589 // CHECK-SPARCV8: "-m" "elf32_sparc" 590 // CHECK-SPARCV8: "-dynamic-linker" "/lib/ld-linux.so.2" 591 // 592 // RUN: %clang %s -### -o %t.o 2>&1 \ 593 // RUN: --target=sparcv9-linux-gnu \ 594 // RUN: | FileCheck --check-prefix=CHECK-SPARCV9 %s 595 // CHECK-SPARCV9: "{{.*}}ld{{(.exe)?}}" 596 // CHECK-SPARCV9: "-m" "elf64_sparc" 597 // CHECK-SPARCV9: "-dynamic-linker" "/lib64/ld-linux.so.2" 598 // 599 // Thoroughly exercise the Debian multiarch environment. 600 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 601 // RUN: --target=i686-linux-gnu \ 602 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 603 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s 604 // CHECK-DEBIAN-X86: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 605 // CHECK-DEBIAN-X86: "{{.*}}/usr/lib/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 606 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5" 607 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../i386-linux-gnu" 608 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu" 609 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../.." 610 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/lib" 611 // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib" 612 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 613 // RUN: --target=x86_64-linux-gnu \ 614 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 615 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s 616 // CHECK-DEBIAN-X86-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 617 // CHECK-DEBIAN-X86-64: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 618 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5" 619 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../x86_64-linux-gnu" 620 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu" 621 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../.." 622 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/lib" 623 // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib" 624 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 625 // RUN: --target=powerpc-linux-gnu \ 626 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 627 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s 628 // CHECK-DEBIAN-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 629 // CHECK-DEBIAN-PPC: "{{.*}}/usr/lib/gcc/powerpc-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 630 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5" 631 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../powerpc-linux-gnu" 632 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/powerpc-linux-gnu" 633 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../.." 634 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/lib" 635 // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib" 636 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 637 // RUN: --target=powerpc64-linux-gnu \ 638 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 639 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s 640 // CHECK-DEBIAN-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 641 // CHECK-DEBIAN-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 642 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5" 643 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../powerpc64-linux-gnu" 644 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/powerpc64-linux-gnu" 645 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../.." 646 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/lib" 647 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib" 648 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 649 // RUN: --target=mips-linux-gnu \ 650 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 651 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS %s 652 // CHECK-DEBIAN-MIPS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 653 // CHECK-DEBIAN-MIPS: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 654 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5" 655 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../../mips-linux-gnu" 656 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/mips-linux-gnu" 657 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.." 658 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/lib" 659 // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib" 660 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 661 // RUN: --target=mipsel-linux-gnu \ 662 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 663 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPSEL %s 664 // CHECK-DEBIAN-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 665 // CHECK-DEBIAN-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5{{/|\\\\}}crtbegin.o" 666 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5" 667 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../../mipsel-linux-gnu" 668 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/mipsel-linux-gnu" 669 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.." 670 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/lib" 671 // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib" 672 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 673 // RUN: --target=mips64-linux-gnu \ 674 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 675 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64 %s 676 // CHECK-DEBIAN-MIPS64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 677 // CHECK-DEBIAN-MIPS64: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o" 678 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/64" 679 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5" 680 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.." 681 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/lib" 682 // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib" 683 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 684 // RUN: --target=mips64el-linux-gnu \ 685 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 686 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL %s 687 // CHECK-DEBIAN-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 688 // CHECK-DEBIAN-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o" 689 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/64" 690 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5" 691 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.." 692 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/lib" 693 // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib" 694 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 695 // RUN: --target=mips64-linux-gnu -mabi=n32 \ 696 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 697 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64-N32 %s 698 // CHECK-DEBIAN-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 699 // CHECK-DEBIAN-MIPS64-N32: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o" 700 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/n32" 701 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5" 702 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.." 703 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/lib" 704 // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib" 705 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 706 // RUN: --target=mips64el-linux-gnu -mabi=n32 \ 707 // RUN: --sysroot=%S/Inputs/debian_multiarch_tree \ 708 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL-N32 %s 709 // CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 710 // CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o" 711 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/n32" 712 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5" 713 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.." 714 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/lib" 715 // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib" 716 // 717 // Test linker invocation on Android. 718 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 719 // RUN: --target=arm-linux-androideabi \ 720 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 721 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 722 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 723 // RUN: --target=arm-linux-android \ 724 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 725 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 726 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 727 // RUN: --target=aarch64-linux-android \ 728 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 729 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 730 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 731 // RUN: --target=arm64-linux-android \ 732 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 733 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 734 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 735 // RUN: --target=mipsel-linux-android \ 736 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 737 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 738 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 739 // RUN: --target=mips64el-linux-android \ 740 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 741 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 742 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 743 // RUN: --target=i686-linux-android \ 744 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 745 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 746 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 747 // RUN: --target=x86_64-linux-android \ 748 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 749 // RUN: | FileCheck --check-prefix=CHECK-ANDROID %s 750 // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 751 // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o" 752 // CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib" 753 // CHECK-ANDROID-NOT: "gcc_s" 754 // CHECK-ANDROID: "-lgcc" 755 // CHECK-ANDROID: "-ldl" 756 // CHECK-ANDROID-NOT: "gcc_s" 757 // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o" 758 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 759 // RUN: --target=arm-linux-androideabi \ 760 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 761 // RUN: -shared \ 762 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 763 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 764 // RUN: --target=arm-linux-android \ 765 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 766 // RUN: -shared \ 767 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 768 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 769 // RUN: --target=aarch64-linux-android \ 770 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 771 // RUN: -shared \ 772 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 773 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 774 // RUN: --target=arm64-linux-android \ 775 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 776 // RUN: -shared \ 777 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 778 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 779 // RUN: --target=mipsel-linux-android \ 780 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 781 // RUN: -shared \ 782 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 783 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 784 // RUN: --target=mips64el-linux-android \ 785 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 786 // RUN: -shared \ 787 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 788 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 789 // RUN: --target=i686-linux-android \ 790 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 791 // RUN: -shared \ 792 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 793 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 794 // RUN: --target=x86_64-linux-android \ 795 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 796 // RUN: -shared \ 797 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s 798 // CHECK-ANDROID-SO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 799 // CHECK-ANDROID-SO-NOT: "-Bsymbolic" 800 // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtbegin_so.o" 801 // CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib" 802 // CHECK-ANDROID-SO-NOT: "gcc_s" 803 // CHECK-ANDROID-SO: "-lgcc" 804 // CHECK-ANDROID-SO: "-ldl" 805 // CHECK-ANDROID-SO-NOT: "gcc_s" 806 // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o" 807 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 808 // RUN: --target=arm-linux-androideabi \ 809 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 810 // RUN: -static \ 811 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 812 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 813 // RUN: --target=arm-linux-android \ 814 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 815 // RUN: -static \ 816 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 817 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 818 // RUN: --target=aarch64-linux-android \ 819 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 820 // RUN: -static \ 821 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 822 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 823 // RUN: --target=arm64-linux-android \ 824 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 825 // RUN: -static \ 826 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 827 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 828 // RUN: --target=mipsel-linux-android \ 829 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 830 // RUN: -static \ 831 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 832 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 833 // RUN: --target=mips64el-linux-android \ 834 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 835 // RUN: -static \ 836 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 837 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 838 // RUN: --target=i686-linux-android \ 839 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 840 // RUN: -static \ 841 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 842 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 843 // RUN: --target=x86-linux-android \ 844 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 845 // RUN: -static \ 846 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s 847 // CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 848 // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtbegin_static.o" 849 // CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib" 850 // CHECK-ANDROID-STATIC-NOT: "gcc_s" 851 // CHECK-ANDROID-STATIC: "-lgcc" 852 // CHECK-ANDROID-STATIC-NOT: "-ldl" 853 // CHECK-ANDROID-STATIC-NOT: "gcc_s" 854 // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o" 855 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 856 // RUN: --target=arm-linux-androideabi \ 857 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 858 // RUN: -pie \ 859 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 860 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 861 // RUN: --target=arm-linux-android \ 862 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 863 // RUN: -pie \ 864 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 865 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 866 // RUN: --target=aarch64-linux-android \ 867 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 868 // RUN: -pie \ 869 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 870 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 871 // RUN: --target=arm64-linux-android \ 872 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 873 // RUN: -pie \ 874 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 875 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 876 // RUN: --target=mipsel-linux-android \ 877 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 878 // RUN: -pie \ 879 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 880 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 881 // RUN: --target=mips64el-linux-android \ 882 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 883 // RUN: -pie \ 884 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 885 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 886 // RUN: --target=i686-linux-android \ 887 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 888 // RUN: -pie \ 889 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 890 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 891 // RUN: --target=x86_64-linux-android \ 892 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 893 // RUN: -pie \ 894 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PIE %s 895 // CHECK-ANDROID-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 896 // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o" 897 // CHECK-ANDROID-PIE: "-L[[SYSROOT]]/usr/lib" 898 // CHECK-ANDROID-PIE-NOT: "gcc_s" 899 // CHECK-ANDROID-PIE: "-lgcc" 900 // CHECK-ANDROID-PIE-NOT: "gcc_s" 901 // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtend_android.o" 902 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 903 // RUN: --target=arm-linux-androideabi \ 904 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 905 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s 906 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 907 // RUN: --target=arm-linux-android \ 908 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 909 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s 910 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 911 // RUN: --target=mipsel-linux-android \ 912 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 913 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s 914 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 915 // RUN: --target=aarch64-linux-android \ 916 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 917 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s 918 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 919 // RUN: --target=arm64-linux-android \ 920 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 921 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s 922 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 923 // RUN: --target=mips64el-linux-android \ 924 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 925 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s 926 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 927 // RUN: --target=i686-linux-android \ 928 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 929 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-32 %s 930 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 931 // RUN: --target=x86_64-linux-android \ 932 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 933 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-64 %s 934 // CHECK-ANDROID-32: "-dynamic-linker" "/system/bin/linker" 935 // CHECK-ANDROID-64: "-dynamic-linker" "/system/bin/linker64" 936 // 937 // Test that -pthread does not add -lpthread on Android. 938 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 939 // RUN: --target=arm-linux-androideabi -pthread \ 940 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 941 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 942 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 943 // RUN: --target=arm-linux-android -pthread \ 944 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 945 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 946 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 947 // RUN: --target=aarch64-linux-android -pthread \ 948 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 949 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 950 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 951 // RUN: --target=arm64-linux-android -pthread \ 952 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 953 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 954 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 955 // RUN: --target=mipsel-linux-android -pthread \ 956 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 957 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 958 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 959 // RUN: --target=mips64el-linux-android -pthread \ 960 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 961 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 962 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 963 // RUN: --target=i686-linux-android -pthread \ 964 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 965 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 966 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 967 // RUN: --target=x86_64-linux-android -pthread \ 968 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 969 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 970 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 971 // RUN: --target=arm-linux-androideabi -pthread \ 972 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 973 // RUN: -shared \ 974 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 975 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 976 // RUN: --target=arm-linux-android -pthread \ 977 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 978 // RUN: -shared \ 979 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 980 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 981 // RUN: --target=aarch64-linux-android -pthread \ 982 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 983 // RUN: -shared \ 984 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 985 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 986 // RUN: --target=arm64-linux-android -pthread \ 987 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 988 // RUN: -shared \ 989 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 990 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 991 // RUN: --target=mipsel-linux-android -pthread \ 992 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 993 // RUN: -shared \ 994 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 995 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 996 // RUN: --target=mips64el-linux-android -pthread \ 997 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 998 // RUN: -shared \ 999 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 1000 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 1001 // RUN: --target=i686-linux-android -pthread \ 1002 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 1003 // RUN: -shared \ 1004 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 1005 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 1006 // RUN: --target=x86_64-linux-android -pthread \ 1007 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 1008 // RUN: -shared \ 1009 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s 1010 // CHECK-ANDROID-PTHREAD-NOT: -lpthread 1011 // 1012 // RUN: %clang -no-canonical-prefixes %t.o -### -o %t 2>&1 \ 1013 // RUN: --target=arm-linux-androideabi -pthread \ 1014 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 1015 // RUN: | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD-LINK %s 1016 // CHECK-ANDROID-PTHREAD-LINK-NOT: argument unused during compilation: '-pthread' 1017 // 1018 // Check linker invocation on Debian 6 MIPS 32/64-bit. 1019 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 1020 // RUN: --target=mipsel-linux-gnu \ 1021 // RUN: --sysroot=%S/Inputs/debian_6_mips_tree \ 1022 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPSEL %s 1023 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 1024 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crt1.o" 1025 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crti.o" 1026 // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4{{/|\\\\}}crtbegin.o" 1027 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4" 1028 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib" 1029 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib/../lib" 1030 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/../lib" 1031 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.." 1032 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib" 1033 // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib" 1034 // 1035 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 1036 // RUN: --target=mips64el-linux-gnu \ 1037 // RUN: --sysroot=%S/Inputs/debian_6_mips_tree \ 1038 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL %s 1039 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 1040 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crt1.o" 1041 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crti.o" 1042 // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/64{{/|\\\\}}crtbegin.o" 1043 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/64" 1044 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64" 1045 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib/../lib64" 1046 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/../lib64" 1047 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.." 1048 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib" 1049 // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib" 1050 // 1051 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 1052 // RUN: --target=mips64el-linux-gnu -mabi=n32 \ 1053 // RUN: --sysroot=%S/Inputs/debian_6_mips_tree \ 1054 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-N32 %s 1055 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 1056 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crt1.o" 1057 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crti.o" 1058 // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/n32{{/|\\\\}}crtbegin.o" 1059 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/n32" 1060 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32" 1061 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib/../lib32" 1062 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/../lib32" 1063 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.." 1064 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib" 1065 // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib" 1066 // 1067 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 1068 // RUN: --target=mips64-linux-gnuabi64 -mabi=n64 \ 1069 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \ 1070 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64-GNUABI %s 1071 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 1072 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crt1.o" 1073 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crti.o" 1074 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtbegin.o" 1075 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9" 1076 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64" 1077 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/lib/mips64-linux-gnuabi64" 1078 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/mips64-linux-gnuabi64" 1079 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9" 1080 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../.." 1081 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/lib" 1082 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib" 1083 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtend.o" 1084 // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crtn.o" 1085 // 1086 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 1087 // RUN: --target=mips64el-linux-gnuabi64 -mabi=n64 \ 1088 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \ 1089 // RUN: | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-GNUABI %s 1090 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 1091 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crt1.o" 1092 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crti.o" 1093 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9{{/|\\\\}}crtbegin.o" 1094 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9" 1095 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64" 1096 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/lib/mips64el-linux-gnuabi64" 1097 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/mips64el-linux-gnuabi64" 1098 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9" 1099 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../.." 1100 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/lib" 1101 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib" 1102 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9{{/|\\\\}}crtend.o" 1103 // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crtn.o" 1104 // 1105 // Test linker invocation for Freescale SDK (OpenEmbedded). 1106 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 1107 // RUN: --target=powerpc-fsl-linux \ 1108 // RUN: --sysroot=%S/Inputs/freescale_ppc_tree \ 1109 // RUN: | FileCheck --check-prefix=CHECK-FSL-PPC %s 1110 // CHECK-FSL-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 1111 // CHECK-FSL-PPC: "-m" "elf32ppclinux" 1112 // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crt1.o" 1113 // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crtbegin.o" 1114 // CHECK-FSL-PPC: "-L[[SYSROOT]]/usr/lib" 1115 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ 1116 // RUN: --target=powerpc64-fsl-linux \ 1117 // RUN: --sysroot=%S/Inputs/freescale_ppc64_tree \ 1118 // RUN: | FileCheck --check-prefix=CHECK-FSL-PPC64 %s 1119 // CHECK-FSL-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" 1120 // CHECK-FSL-PPC64: "-m" "elf64ppc" 1121 // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crt1.o" 1122 // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crtbegin.o" 1123 // CHECK-FSL-PPC64: "-L[[SYSROOT]]/usr/lib64/powerpc64-fsl-linux/4.6.2/../.." 1124 // 1125 // Check that crtfastmath.o is linked with -ffast-math and with -Ofast. 1126 // RUN: %clang --target=x86_64-unknown-linux -### %s \ 1127 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1128 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s 1129 // RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math \ 1130 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1131 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s 1132 // RUN: %clang --target=x86_64-unknown-linux -### %s -funsafe-math-optimizations\ 1133 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1134 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s 1135 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast\ 1136 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1137 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s 1138 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -O3\ 1139 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1140 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s 1141 // RUN: %clang --target=x86_64-unknown-linux -### %s -O3 -Ofast\ 1142 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1143 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s 1144 // RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -fno-fast-math \ 1145 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1146 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s 1147 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-fast-math \ 1148 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1149 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s 1150 // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-unsafe-math-optimizations \ 1151 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1152 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s 1153 // RUN: %clang --target=x86_64-unknown-linux -### %s -fno-fast-math -Ofast \ 1154 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1155 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s 1156 // RUN: %clang --target=x86_64-unknown-linux -### %s -fno-unsafe-math-optimizations -Ofast \ 1157 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1158 // RUN: | FileCheck --check-prefix=CHECK-CRTFASTMATH %s 1159 // We don't have crtfastmath.o in the i386 tree, use it to check that file 1160 // detection works. 1161 // RUN: %clang --target=i386-unknown-linux -### %s -ffast-math \ 1162 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \ 1163 // RUN: | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s 1164 // CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtfastmath.o 1165 // CHECK-NOCRTFASTMATH-NOT: crtfastmath.o 1166 1167 // Check that we link in gcrt1.o when compiling with -pg 1168 // RUN: %clang -pg --target=x86_64-unknown-linux -### %s \ 1169 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \ 1170 // RUN: | FileCheck --check-prefix=CHECK-PG %s 1171 // CHECK-PG: gcrt1.o 1172 1173 // GCC forwards -u to the linker. 1174 // RUN: %clang -u asdf --target=x86_64-unknown-linux -### %s \ 1175 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \ 1176 // RUN: | FileCheck --check-prefix=CHECK-u %s 1177 // CHECK-u: "-u" "asdf" 1178