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