1 // ----------------------------------------------------------------------------- 2 // Test standard include paths 3 // ----------------------------------------------------------------------------- 4 5 // RUN: %clang -### -target hexagon-unknown-elf \ 6 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 7 // RUN: %s 2>&1 \ 8 // RUN: | FileCheck -check-prefix=CHECK000 %s 9 // CHECK000: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include" 10 11 // RUN: %clangxx -### -target hexagon-unknown-elf \ 12 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 13 // RUN: %s 2>&1 \ 14 // RUN: | FileCheck -check-prefix=CHECK001 %s 15 // CHECK001: "-cc1" {{.*}} "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include/c++" 16 // CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include" 17 18 // ----------------------------------------------------------------------------- 19 // Test -nostdinc, -nostdlibinc, -nostdinc++ 20 // ----------------------------------------------------------------------------- 21 22 // RUN: %clang -### -target hexagon-unknown-elf \ 23 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 24 // RUN: -nostdinc \ 25 // RUN: %s 2>&1 \ 26 // RUN: | FileCheck -check-prefix=CHECK010 %s 27 // CHECK010: "-cc1" 28 // CHECK010-NOT: "-internal-externc-isystem" 29 30 // RUN: %clang -### -target hexagon-unknown-elf \ 31 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 32 // RUN: -nostdlibinc \ 33 // RUN: %s 2>&1 \ 34 // RUN: | FileCheck -check-prefix=CHECK011 %s 35 // CHECK011: "-cc1" 36 // CHECK011-NOT: "-internal-externc-isystem" 37 38 // RUN: %clangxx -### -target hexagon-unknown-elf \ 39 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 40 // RUN: -nostdinc++ \ 41 // RUN: %s 2>&1 \ 42 // RUN: | FileCheck -check-prefix=CHECK012 %s 43 // CHECK012: "-cc1" 44 // CHECK012-NOT: "-internal-isystem" 45 // CHECK012-DAG: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include" 46 47 // RUN: %clangxx -### -target hexagon-unknown-elf -fno-integrated-as \ 48 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \ 49 // RUN: --gcc-toolchain="" \ 50 // RUN: -nostdlibinc \ 51 // RUN: %s 2>&1 \ 52 // RUN: | FileCheck -check-prefix=CHECK013 %s 53 // CHECK013: "-cc1" 54 // CHECK013-NOT: "-internal-isystem" 55 // CHECK013-NOT: "-internal-externc-isystem" 56 57 // ----------------------------------------------------------------------------- 58 // Test -mcpu=<cpuname> -mv<number> 59 // ----------------------------------------------------------------------------- 60 // RUN: %clang -### -target hexagon-unknown-elf \ 61 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 62 // RUN: -mcpu=hexagonv5 \ 63 // RUN: %s 2>&1 \ 64 // RUN: | FileCheck -check-prefix=CHECK021 %s 65 // CHECK021: "-cc1" {{.*}} "-target-cpu" "hexagonv5" 66 // CHECK021: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v5/crt0 67 68 // RUN: %clang -### -target hexagon-unknown-elf \ 69 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 70 // RUN: -mcpu=hexagonv55 \ 71 // RUN: %s 2>&1 \ 72 // RUN: | FileCheck -check-prefix=CHECK022 %s 73 // CHECK022: "-cc1" {{.*}} "-target-cpu" "hexagonv55" 74 // CHECK022: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v55/crt0 75 76 // RUN: %clang -### -target hexagon-unknown-elf \ 77 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 78 // RUN: -mcpu=hexagonv60 \ 79 // RUN: %s 2>&1 \ 80 // RUN: | FileCheck -check-prefix=CHECK023 %s 81 // CHECK023: "-cc1" {{.*}} "-target-cpu" "hexagonv60" 82 // CHECK023: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0 83 84 // RUN: %clang -### -target hexagon-unknown-elf \ 85 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 86 // RUN: -mcpu=hexagonv62 \ 87 // RUN: %s 2>&1 \ 88 // RUN: | FileCheck -check-prefix=CHECK024 %s 89 // CHECK024: "-cc1" {{.*}} "-target-cpu" "hexagonv62" 90 // CHECK024: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v62/crt0 91 92 // RUN: %clang -### -target hexagon-unknown-elf \ 93 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 94 // RUN: -mcpu=hexagonv65 \ 95 // RUN: %s 2>&1 \ 96 // RUN: | FileCheck -check-prefix=CHECK025 %s 97 // CHECK025: "-cc1" {{.*}} "-target-cpu" "hexagonv65" 98 // CHECK025: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v65/crt0 99 100 // RUN: %clang -### -target hexagon-unknown-elf \ 101 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 102 // RUN: -mcpu=hexagonv66 \ 103 // RUN: %s 2>&1 \ 104 // RUN: | FileCheck -check-prefix=CHECK026 %s 105 // CHECK026: "-cc1" {{.*}} "-target-cpu" "hexagonv66" 106 // CHECK026: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v66/crt0 107 108 // RUN: %clang -### -target hexagon-unknown-elf \ 109 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 110 // RUN: -O3 \ 111 // RUN: %s 2>&1 \ 112 // RUN: | FileCheck -check-prefix=CHECK027 %s 113 // CHECK027-NOT: "-ffp-contract=fast" 114 // CHECK027: {{hexagon-link|ld}} 115 116 // RUN: %clang -### -target hexagon-unknown-elf \ 117 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 118 // RUN: -O3 -ffp-contract=off \ 119 // RUN: %s 2>&1 \ 120 // RUN: | FileCheck -check-prefix=CHECK028 %s 121 // CHECK028-NOT: "-ffp-contract=fast" 122 // CHECK028: {{hexagon-link|ld}} 123 124 // RUN: %clang -### -target hexagon-unknown-elf \ 125 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 126 // RUN: -mcpu=hexagonv65 -march=hexagon\ 127 // RUN: %s 2>&1 \ 128 // RUN: | FileCheck -check-prefix=CHECK029 %s 129 // RUN: %clang -### -target hexagon-unknown-elf \ 130 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 131 // RUN: -mv65 -march=hexagon\ 132 // RUN: %s 2>&1 \ 133 // RUN: | FileCheck -check-prefix=CHECK029 %s 134 // CHECK029: "-cc1" {{.*}} "-target-cpu" "hexagonv65" 135 // CHECK029: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v65/crt0 136 137 // RUN: %clang -### -target hexagon-unknown-elf \ 138 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 139 // RUN: -mcpu=hexagonv67 -fuse-ld=hexagon-link\ 140 // RUN: %s 2>&1 \ 141 // RUN: | FileCheck -check-prefix=CHECK02A %s 142 // CHECK02A: "-cc1" {{.*}} "-target-cpu" "hexagonv67" 143 // CHECK02A: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v67/crt0 144 145 // RUN: %clang -### -target hexagon-unknown-elf \ 146 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 147 // RUN: -mcpu=hexagonv67t \ 148 // RUN: -fuse-ld=fake-value-to-ignore-CLANG_DEFAULT_LINKER \ 149 // RUN: %s 2>&1 \ 150 // RUN: | FileCheck -check-prefix=CHECK02B %s 151 // CHECK02B: "-cc1" {{.*}} "-target-cpu" "hexagonv67t" 152 // CHECK02B: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v67t/crt0 153 154 // ----------------------------------------------------------------------------- 155 // Test Linker related args 156 // ----------------------------------------------------------------------------- 157 158 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 159 // Defaults for C 160 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 161 // RUN: %clang -### -target hexagon-unknown-elf \ 162 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 163 // RUN: -mcpu=hexagonv60 \ 164 // RUN: %s 2>&1 \ 165 // RUN: | FileCheck -check-prefix=CHECK030 %s 166 // CHECK030: "-cc1" 167 // CHECK030: {{hexagon-link|ld}} 168 // CHECK030-NOT: "-static" 169 // CHECK030-NOT: "-shared" 170 // CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" 171 // CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" 172 // CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o" 173 // CHECK030: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 174 // CHECK030: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 175 // CHECK030: "{{[^"]+}}.o" 176 // CHECK030: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" 177 // CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o" 178 179 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 180 // Defaults for C++ 181 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 182 // RUN: %clangxx -### -target hexagon-unknown-elf \ 183 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 184 // RUN: -mcpu=hexagonv60 \ 185 // RUN: %s 2>&1 \ 186 // RUN: | FileCheck -check-prefix=CHECK031 %s 187 // CHECK031: "-cc1" 188 // CHECK031: {{hexagon-link|ld}} 189 // CHECK031-NOT: "-static" 190 // CHECK031-NOT: "-shared" 191 // CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" 192 // CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" 193 // CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o" 194 // CHECK031: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 195 // CHECK031: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 196 // CHECK031: "{{[^"]+}}.o" 197 // CHECK031: "-lstdc++" "-lm" 198 // CHECK031: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" 199 // CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o" 200 201 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 202 // Additional Libraries (-L) 203 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 204 // RUN: %clang -### -target hexagon-unknown-elf \ 205 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 206 // RUN: -mcpu=hexagonv60 \ 207 // RUN: -Lone -L two -L three \ 208 // RUN: %s 2>&1 \ 209 // RUN: | FileCheck -check-prefix=CHECK032 %s 210 // CHECK032: "-cc1" 211 // CHECK032: {{hexagon-link|ld}} 212 // CHECK032-NOT: "-static" 213 // CHECK032-NOT: "-shared" 214 // CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" 215 // CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" 216 // CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o" 217 // CHECK032: "-Lone" "-Ltwo" "-Lthree" 218 // CHECK032: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 219 // CHECK032: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 220 // CHECK032: "{{[^"]+}}.o" 221 // CHECK032: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" 222 // CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o" 223 224 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 225 // -static, -shared 226 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 227 // RUN: %clang -### -target hexagon-unknown-elf \ 228 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 229 // RUN: -mcpu=hexagonv60 \ 230 // RUN: -static \ 231 // RUN: %s 2>&1 \ 232 // RUN: | FileCheck -check-prefix=CHECK033 %s 233 // CHECK033: "-cc1" 234 // CHECK033: {{hexagon-link|ld}} 235 // CHECK033: "-static" 236 // CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" 237 // CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" 238 // CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o" 239 // CHECK033: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 240 // CHECK033: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 241 // CHECK033: "{{[^"]+}}.o" 242 // CHECK033: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" 243 // CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o" 244 245 // RUN: %clang -### -target hexagon-unknown-elf \ 246 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 247 // RUN: -mcpu=hexagonv60 \ 248 // RUN: -shared \ 249 // RUN: %s 2>&1 \ 250 // RUN: | FileCheck -check-prefix=CHECK034 %s 251 // CHECK034: "-cc1" 252 // CHECK034: {{hexagon-link|ld}} 253 // CHECK034: "-shared" "-call_shared" 254 // CHECK034-NOT: crt0_standalone.o 255 // CHECK034-NOT: crt0.o 256 // CHECK034: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/pic/initS.o" 257 // CHECK034: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0" 258 // CHECK034: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 259 // CHECK034: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 260 // CHECK034: "{{[^"]+}}.o" 261 // CHECK034: "--start-group" 262 // CHECK034-NOT: "-lstandalone" 263 // CHECK034-NOT: "-lc" 264 // CHECK034: "-lgcc" 265 // CHECK034: "--end-group" 266 // CHECK034: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/pic/finiS.o" 267 268 // RUN: %clang -### -target hexagon-unknown-elf \ 269 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 270 // RUN: -mcpu=hexagonv60 \ 271 // RUN: -shared \ 272 // RUN: -static \ 273 // RUN: %s 2>&1 \ 274 // RUN: | FileCheck -check-prefix=CHECK035 %s 275 // CHECK035: "-cc1" 276 // CHECK035: {{hexagon-link|ld}} 277 // CHECK035: "-shared" "-call_shared" "-static" 278 // CHECK035-NOT: crt0_standalone.o 279 // CHECK035-NOT: crt0.o 280 // CHECK035: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/init.o" 281 // CHECK035: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0" 282 // CHECK035: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 283 // CHECK035: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 284 // CHECK035: "{{[^"]+}}.o" 285 // CHECK035: "--start-group" 286 // CHECK035-NOT: "-lstandalone" 287 // CHECK035-NOT: "-lc" 288 // CHECK035: "-lgcc" 289 // CHECK035: "--end-group" 290 // CHECK035: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/fini.o" 291 292 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 293 // -nostdlib, -nostartfiles, -nodefaultlibs 294 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 295 // RUN: %clangxx -### -target hexagon-unknown-elf \ 296 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 297 // RUN: -mcpu=hexagonv60 \ 298 // RUN: -nostdlib \ 299 // RUN: %s 2>&1 \ 300 // RUN: | FileCheck -check-prefix=CHECK036 %s 301 // CHECK036: "-cc1" 302 // CHECK036: {{hexagon-link|ld}} 303 // CHECK036-NOT: crt0_standalone.o 304 // CHECK036-NOT: crt0.o 305 // CHECK036-NOT: init.o 306 // CHECK036: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 307 // CHECK036: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 308 // CHECK036: "{{[^"]+}}.o" 309 // CHECK036-NOT: "-lstdc++" 310 // CHECK036-NOT: "-lm" 311 // CHECK036-NOT: "--start-group" 312 // CHECK036-NOT: "-lstandalone" 313 // CHECK036-NOT: "-lc" 314 // CHECK036-NOT: "-lgcc" 315 // CHECK036-NOT: "--end-group" 316 // CHECK036-NOT: fini.o 317 318 // RUN: %clangxx -### -target hexagon-unknown-elf \ 319 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 320 // RUN: -mcpu=hexagonv60 \ 321 // RUN: -nostartfiles \ 322 // RUN: %s 2>&1 \ 323 // RUN: | FileCheck -check-prefix=CHECK037 %s 324 // CHECK037: "-cc1" 325 // CHECK037: {{hexagon-link|ld}} 326 // CHECK037-NOT: crt0_standalone.o 327 // CHECK037-NOT: crt0.o 328 // CHECK037-NOT: init.o 329 // CHECK037: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 330 // CHECK037: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 331 // CHECK037: "{{[^"]+}}.o" 332 // CHECK037: "-lstdc++" 333 // CHECK037: "-lm" 334 // CHECK037: "--start-group" 335 // CHECK037: "-lstandalone" 336 // CHECK037: "-lc" 337 // CHECK037: "-lgcc" 338 // CHECK037: "--end-group" 339 // CHECK037-NOT: fini.o 340 341 // RUN: %clangxx -### -target hexagon-unknown-elf \ 342 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 343 // RUN: -mcpu=hexagonv60 \ 344 // RUN: -nodefaultlibs \ 345 // RUN: %s 2>&1 \ 346 // RUN: | FileCheck -check-prefix=CHECK038 %s 347 // CHECK038: "-cc1" 348 // CHECK038: {{hexagon-link|ld}} 349 // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" 350 // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" 351 // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o" 352 // CHECK038: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 353 // CHECK038: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 354 // CHECK038: "{{[^"]+}}.o" 355 // CHECK038-NOT: "-lstdc++" 356 // CHECK038-NOT: "-lm" 357 // CHECK038-NOT: "--start-group" 358 // CHECK038-NOT: "-lstandalone" 359 // CHECK038-NOT: "-lc" 360 // CHECK038-NOT: "-lgcc" 361 // CHECK038-NOT: "--end-group" 362 // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o" 363 364 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 365 // -moslib 366 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 367 // RUN: %clang -### -target hexagon-unknown-elf \ 368 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 369 // RUN: -mcpu=hexagonv60 \ 370 // RUN: -moslib=first -moslib=second \ 371 // RUN: %s 2>&1 \ 372 // RUN: | FileCheck -check-prefix=CHECK039 %s 373 // CHECK039: "-cc1" 374 // CHECK039: {{hexagon-link|ld}} 375 // CHECK039-NOT: "-static" 376 // CHECK039-NOT: "-shared" 377 // CHECK039-NOT: crt0_standalone.o 378 // CHECK039: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" 379 // CHECK039: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o" 380 // CHECK039: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 381 // CHECK039: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 382 // CHECK039: "{{[^"]+}}.o" 383 // CHECK039: "--start-group" 384 // CHECK039: "-lfirst" "-lsecond" 385 // CHECK039-NOT: "-lstandalone" 386 // CHECK039: "-lc" "-lgcc" "--end-group" 387 // CHECK039: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o" 388 389 // RUN: %clang -### -target hexagon-unknown-elf \ 390 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 391 // RUN: -mcpu=hexagonv60 \ 392 // RUN: -moslib=first -moslib=second -moslib=standalone \ 393 // RUN: %s 2>&1 \ 394 // RUN: | FileCheck -check-prefix=CHECK03A %s 395 // CHECK03A: "-cc1" 396 // CHECK03A: {{hexagon-link|ld}} 397 // CHECK03A-NOT: "-static" 398 // CHECK03A-NOT: "-shared" 399 // CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" 400 // CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" 401 // CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o" 402 // CHECK03A: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 403 // CHECK03A: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 404 // CHECK03A: "{{[^"]+}}.o" 405 // CHECK03A: "--start-group" 406 // CHECK03A: "-lfirst" "-lsecond" 407 // CHECK03A: "-lstandalone" 408 // CHECK03A: "-lc" "-lgcc" "--end-group" 409 // CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o" 410 411 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 412 // Other args to pass to linker 413 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 414 // RUN: %clangxx -### -target hexagon-unknown-elf \ 415 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 416 // RUN: -mcpu=hexagonv60 \ 417 // RUN: -s \ 418 // RUN: -Tbss 0xdead -Tdata 0xbeef -Ttext 0xcafe \ 419 // RUN: -t \ 420 // RUN: -e start_here \ 421 // RUN: -uFoo -undefined Bar \ 422 // RUN: %s 2>&1 \ 423 // RUN: | FileCheck -check-prefix=CHECK03B %s 424 // CHECK03B: "-cc1" 425 // CHECK03B: {{hexagon-link|ld}} 426 // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o" 427 // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o" 428 // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o" 429 // CHECK03B: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60" 430 // CHECK03B: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib" 431 // CHECK03B: "-s" 432 // CHECK03B: "-Tbss" "0xdead" "-Tdata" "0xbeef" "-Ttext" "0xcafe" 433 // CHECK03B: "-t" 434 // CHECK03B: "-u" "Foo" "-undefined" "Bar" 435 // CHECK03B: "{{[^"]+}}.o" 436 // CHECK03B: "-lstdc++" "-lm" 437 // CHECK03B: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group" 438 // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o" 439 440 // ----------------------------------------------------------------------------- 441 // pic, small data threshold 442 // ----------------------------------------------------------------------------- 443 // RUN: %clang -### -target hexagon-unknown-elf \ 444 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 445 // RUN: -mcpu=hexagonv60 \ 446 // RUN: %s 2>&1 \ 447 // RUN: | FileCheck -check-prefix=CHECK040 %s 448 // CHECK040: "-cc1" 449 // CHECK040: {{hexagon-link|ld}} 450 // CHECK040-NOT: "-G{{[0-9]+}}" 451 452 // RUN: %clang -### -target hexagon-unknown-elf \ 453 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 454 // RUN: -mcpu=hexagonv60 \ 455 // RUN: -fpic \ 456 // RUN: %s 2>&1 \ 457 // RUN: | FileCheck -check-prefix=CHECK041 %s 458 // RUN: %clang -### -target hexagon-unknown-elf \ 459 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 460 // RUN: -mcpu=hexagonv60 \ 461 // RUN: -fPIC \ 462 // RUN: %s 2>&1 \ 463 // RUN: | FileCheck -check-prefix=CHECK041 %s 464 // CHECK041: "-cc1" 465 // CHECK041-NOT: "-mrelocation-model" "static" 466 // CHECK041: "-pic-level" "{{[12]}}" 467 // CHECK041: "-mllvm" "-hexagon-small-data-threshold=0" 468 // CHECK041: {{hexagon-link|ld}} 469 // CHECK041: "-G0" 470 471 // RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \ 472 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 473 // RUN: -mcpu=hexagonv60 \ 474 // RUN: -G=8 \ 475 // RUN: %s 2>&1 \ 476 // RUN: | FileCheck -check-prefix=CHECK042 %s 477 // RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \ 478 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 479 // RUN: -mcpu=hexagonv60 \ 480 // RUN: -G 8 \ 481 // RUN: %s 2>&1 \ 482 // RUN: | FileCheck -check-prefix=CHECK042 %s 483 // RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \ 484 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 485 // RUN: -mcpu=hexagonv60 \ 486 // RUN: -msmall-data-threshold=8 \ 487 // RUN: %s 2>&1 \ 488 // RUN: | FileCheck -check-prefix=CHECK042 %s 489 // CHECK042: "-cc1" 490 // CHECK042: "-mrelocation-model" "static" 491 // CHECK042: "-mllvm" "-hexagon-small-data-threshold=8" 492 // CHECK042-NEXT: llvm-mc 493 // CHECK042: "-gpsize=8" 494 // CHECK042: {{hexagon-link|ld}} 495 // CHECK042: "-G8" 496 497 // ----------------------------------------------------------------------------- 498 // pie 499 // ----------------------------------------------------------------------------- 500 // RUN: %clang -### -target hexagon-unknown-elf \ 501 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 502 // RUN: -mcpu=hexagonv60 \ 503 // RUN: -pie \ 504 // RUN: %s 2>&1 \ 505 // RUN: | FileCheck -check-prefix=CHECK050 %s 506 // CHECK050: "-cc1" 507 // CHECK050: {{hexagon-link|ld}} 508 // CHECK050: "-pie" 509 510 // RUN: %clang -### -target hexagon-unknown-elf \ 511 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 512 // RUN: -mcpu=hexagonv60 \ 513 // RUN: -pie -shared \ 514 // RUN: %s 2>&1 \ 515 // RUN: | FileCheck -check-prefix=CHECK051 %s 516 // CHECK051: "-cc1" 517 // CHECK051: {{hexagon-link|ld}} 518 // CHECK051-NOT: "-pie" 519 520 // ----------------------------------------------------------------------------- 521 // Test Assembler related args 522 // ----------------------------------------------------------------------------- 523 // RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \ 524 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 525 // RUN: -mcpu=hexagonv60 \ 526 // RUN: -gdwarf-2 \ 527 // RUN: -Wa,--noexecstack,--trap \ 528 // RUN: -Xassembler --keep-locals \ 529 // RUN: %s 2>&1 \ 530 // RUN: | FileCheck -check-prefix=CHECK060 %s 531 // CHECK060: "-cc1" 532 // CHECK060-NEXT: llvm-mc 533 // CHECK060: "--noexecstack" "--trap" "--keep-locals" 534 // CHECK060: {{hexagon-link|ld}} 535 536 // ----------------------------------------------------------------------------- 537 // ffixed-r19 538 // ----------------------------------------------------------------------------- 539 // RUN: %clang -### -target hexagon-unknown-elf -ffixed-r19 %s 2>&1 \ 540 // RUN: | FileCheck --check-prefix=CHECK070 %s 541 // CHECK070: "-target-feature" "+reserved-r19" 542 // RUN: %clang -### -target hexagon-unknown-elf %s 2>&1 \ 543 // RUN: | FileCheck --check-prefix=CHECK071 %s 544 // CHECK071-NOT: "+reserved-r19" 545 546 // ----------------------------------------------------------------------------- 547 // Misc Defaults 548 // ----------------------------------------------------------------------------- 549 // RUN: %clang -### -target hexagon-unknown-elf \ 550 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 551 // RUN: -mcpu=hexagonv60 \ 552 // RUN: %s 2>&1 \ 553 // RUN: | FileCheck -check-prefix=CHECK080 %s 554 // CHECK080: "-cc1" 555 // CHECK080: "-Wreturn-type" 556 557 // ----------------------------------------------------------------------------- 558 // Default, hexagon-link is used 559 // ----------------------------------------------------------------------------- 560 // RUN: %clang -### -target hexagon-unknown-elf \ 561 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 562 // RUN: -mcpu=hexagonv60 \ 563 // RUN: -fuse-ld=fake-value-to-ignore-CLANG_DEFAULT_LINKER \ 564 // RUN: %s 2>&1 \ 565 // RUN: | FileCheck -check-prefix=CHECK081 %s 566 // REQUIRES: hexagon-registered-target 567 // CHECK081: "-march=hexagon" 568 // CHECK081: "-mcpu=hexagonv60" 569 // ----------------------------------------------------------------------------- 570 // Passing -fuse-ld=lld 571 // ----------------------------------------------------------------------------- 572 // RUN: %clang -### -target hexagon-unknown-elf \ 573 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 574 // RUN: -mcpu=hexagonv60 \ 575 // RUN: -fuse-ld=lld \ 576 // RUN: %s 2>&1 \ 577 // RUN: | FileCheck -check-prefix=CHECK082 %s 578 // CHECK082-NOT: -march= 579 // CHECK082-NOT: -mcpu= 580 // ----------------------------------------------------------------------------- 581 // Passing --sysroot 582 // ----------------------------------------------------------------------------- 583 // RUN: %clang -### -target hexagon-unknown-elf \ 584 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 585 // RUN: -mcpu=hexagonv60 \ 586 // RUN: --sysroot=/hexagon \ 587 // RUN: %s 2>&1 \ 588 // RUN: | FileCheck -check-prefix=CHECK083 %s 589 // CHECK083: "-isysroot" "/hexagon" 590 // CHECK083: "-internal-externc-isystem" "/hexagon{{/|\\\\}}include" 591 // ----------------------------------------------------------------------------- 592 // Passing -fno-use-init-array 593 // ----------------------------------------------------------------------------- 594 // RUN: %clang -### -target hexagon-unknown-elf \ 595 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \ 596 // RUN: -mcpu=hexagonv60 \ 597 // RUN: %s 2>&1 \ 598 // RUN: | FileCheck -check-prefix=CHECK084 %s 599 // CHECK084: "-fno-use-init-array" 600