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