Home | History | Annotate | Download | only in Driver
      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=hexagonv4 \
     63 // RUN:   %s 2>&1 \
     64 // RUN:   | FileCheck -check-prefix=CHECK020 %s
     65 // CHECK020: "-cc1" {{.*}} "-target-cpu" "hexagonv4"
     66 // CHECK020: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v4/crt0
     67 
     68 // RUN: %clang -### -target hexagon-unknown-elf \
     69 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
     70 // RUN:   -mcpu=hexagonv5 \
     71 // RUN:   %s 2>&1 \
     72 // RUN:   | FileCheck -check-prefix=CHECK021 %s
     73 // CHECK021: "-cc1" {{.*}} "-target-cpu" "hexagonv5"
     74 // CHECK021: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v5/crt0
     75 
     76 // RUN: %clang -### -target hexagon-unknown-elf \
     77 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
     78 // RUN:   -mcpu=hexagonv55 \
     79 // RUN:   %s 2>&1 \
     80 // RUN:   | FileCheck -check-prefix=CHECK022 %s
     81 // CHECK022: "-cc1" {{.*}} "-target-cpu" "hexagonv55"
     82 // CHECK022: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v55/crt0
     83 
     84 // RUN: %clang -### -target hexagon-unknown-elf \
     85 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
     86 // RUN:   -mcpu=hexagonv60 \
     87 // RUN:   %s 2>&1 \
     88 // RUN:   | FileCheck -check-prefix=CHECK023 %s
     89 // CHECK023: "-cc1" {{.*}} "-target-cpu" "hexagonv60"
     90 // CHECK023: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0
     91 
     92 // -----------------------------------------------------------------------------
     93 // Test Linker related args
     94 // -----------------------------------------------------------------------------
     95 
     96 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     97 // Defaults for C
     98 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     99 // RUN: %clang -### -target hexagon-unknown-elf \
    100 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    101 // RUN:   -mcpu=hexagonv60 \
    102 // RUN:   %s 2>&1 \
    103 // RUN:   | FileCheck -check-prefix=CHECK030 %s
    104 // CHECK030: "-cc1"
    105 // CHECK030-NEXT: hexagon-link
    106 // CHECK030-NOT: "-static"
    107 // CHECK030-NOT: "-shared"
    108 // CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
    109 // CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
    110 // CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
    111 // CHECK030: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    112 // CHECK030: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    113 // CHECK030: "{{[^"]+}}.o"
    114 // CHECK030: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
    115 // CHECK030: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
    116 
    117 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    118 // Defaults for C++
    119 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    120 // RUN: %clangxx -### -target hexagon-unknown-elf \
    121 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    122 // RUN:   -mcpu=hexagonv60 \
    123 // RUN:   %s 2>&1 \
    124 // RUN:   | FileCheck -check-prefix=CHECK031 %s
    125 // CHECK031: "-cc1"
    126 // CHECK031-NEXT: hexagon-link
    127 // CHECK031-NOT: "-static"
    128 // CHECK031-NOT: "-shared"
    129 // CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
    130 // CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
    131 // CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
    132 // CHECK031: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    133 // CHECK031: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    134 // CHECK031: "{{[^"]+}}.o"
    135 // CHECK031: "-lstdc++" "-lm"
    136 // CHECK031: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
    137 // CHECK031: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
    138 
    139 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    140 // Additional Libraries (-L)
    141 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    142 // RUN: %clang -### -target hexagon-unknown-elf \
    143 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    144 // RUN:   -mcpu=hexagonv60 \
    145 // RUN:   -Lone -L two -L three \
    146 // RUN:   %s 2>&1 \
    147 // RUN:   | FileCheck -check-prefix=CHECK032 %s
    148 // CHECK032: "-cc1"
    149 // CHECK032-NEXT: hexagon-link
    150 // CHECK032-NOT: "-static"
    151 // CHECK032-NOT: "-shared"
    152 // CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
    153 // CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
    154 // CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
    155 // CHECK032: "-Lone" "-Ltwo" "-Lthree"
    156 // CHECK032: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    157 // CHECK032: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    158 // CHECK032: "{{[^"]+}}.o"
    159 // CHECK032: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
    160 // CHECK032: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
    161 
    162 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    163 // -static, -shared
    164 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    165 // RUN: %clang -### -target hexagon-unknown-elf \
    166 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    167 // RUN:   -mcpu=hexagonv60 \
    168 // RUN:   -static \
    169 // RUN:   %s 2>&1 \
    170 // RUN:   | FileCheck -check-prefix=CHECK033 %s
    171 // CHECK033: "-cc1"
    172 // CHECK033-NEXT: hexagon-link
    173 // CHECK033: "-static"
    174 // CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
    175 // CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
    176 // CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
    177 // CHECK033: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    178 // CHECK033: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    179 // CHECK033: "{{[^"]+}}.o"
    180 // CHECK033: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
    181 // CHECK033: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
    182 
    183 // RUN: %clang -### -target hexagon-unknown-elf \
    184 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    185 // RUN:   -mcpu=hexagonv60 \
    186 // RUN:   -shared \
    187 // RUN:   %s 2>&1 \
    188 // RUN:   | FileCheck -check-prefix=CHECK034 %s
    189 // CHECK034: "-cc1"
    190 // CHECK034-NEXT: hexagon-link
    191 // CHECK034: "-shared" "-call_shared"
    192 // CHECK034-NOT: crt0_standalone.o
    193 // CHECK034-NOT: crt0.o
    194 // CHECK034: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/pic/initS.o"
    195 // CHECK034: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0"
    196 // CHECK034: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    197 // CHECK034: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    198 // CHECK034: "{{[^"]+}}.o"
    199 // CHECK034: "--start-group"
    200 // CHECK034-NOT: "-lstandalone"
    201 // CHECK034-NOT: "-lc"
    202 // CHECK034: "-lgcc"
    203 // CHECK034: "--end-group"
    204 // CHECK034: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/pic/finiS.o"
    205 
    206 // RUN: %clang -### -target hexagon-unknown-elf \
    207 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    208 // RUN:   -mcpu=hexagonv60 \
    209 // RUN:   -shared \
    210 // RUN:   -static \
    211 // RUN:   %s 2>&1 \
    212 // RUN:   | FileCheck -check-prefix=CHECK035 %s
    213 // CHECK035: "-cc1"
    214 // CHECK035-NEXT: hexagon-link
    215 // CHECK035: "-shared" "-call_shared" "-static"
    216 // CHECK035-NOT: crt0_standalone.o
    217 // CHECK035-NOT: crt0.o
    218 // CHECK035: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/init.o"
    219 // CHECK035: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0"
    220 // CHECK035: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    221 // CHECK035: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    222 // CHECK035: "{{[^"]+}}.o"
    223 // CHECK035: "--start-group"
    224 // CHECK035-NOT: "-lstandalone"
    225 // CHECK035-NOT: "-lc"
    226 // CHECK035: "-lgcc"
    227 // CHECK035: "--end-group"
    228 // CHECK035: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/fini.o"
    229 
    230 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    231 // -nostdlib, -nostartfiles, -nodefaultlibs
    232 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    233 // RUN: %clangxx -### -target hexagon-unknown-elf \
    234 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    235 // RUN:   -mcpu=hexagonv60 \
    236 // RUN:   -nostdlib \
    237 // RUN:   %s 2>&1 \
    238 // RUN:   | FileCheck -check-prefix=CHECK036 %s
    239 // CHECK036: "-cc1"
    240 // CHECK036-NEXT: hexagon-link
    241 // CHECK036-NOT: crt0_standalone.o
    242 // CHECK036-NOT: crt0.o
    243 // CHECK036-NOT: init.o
    244 // CHECK036: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    245 // CHECK036: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    246 // CHECK036: "{{[^"]+}}.o"
    247 // CHECK036-NOT: "-lstdc++"
    248 // CHECK036-NOT: "-lm"
    249 // CHECK036-NOT: "--start-group"
    250 // CHECK036-NOT: "-lstandalone"
    251 // CHECK036-NOT: "-lc"
    252 // CHECK036-NOT: "-lgcc"
    253 // CHECK036-NOT: "--end-group"
    254 // CHECK036-NOT: fini.o
    255 
    256 // RUN: %clangxx -### -target hexagon-unknown-elf \
    257 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    258 // RUN:   -mcpu=hexagonv60 \
    259 // RUN:   -nostartfiles \
    260 // RUN:   %s 2>&1 \
    261 // RUN:   | FileCheck -check-prefix=CHECK037 %s
    262 // CHECK037: "-cc1"
    263 // CHECK037-NEXT: hexagon-link
    264 // CHECK037-NOT: crt0_standalone.o
    265 // CHECK037-NOT: crt0.o
    266 // CHECK037-NOT: init.o
    267 // CHECK037: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    268 // CHECK037: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    269 // CHECK037: "{{[^"]+}}.o"
    270 // CHECK037: "-lstdc++"
    271 // CHECK037: "-lm"
    272 // CHECK037: "--start-group"
    273 // CHECK037: "-lstandalone"
    274 // CHECK037: "-lc"
    275 // CHECK037: "-lgcc"
    276 // CHECK037: "--end-group"
    277 // CHECK037-NOT: fini.o
    278 
    279 // RUN: %clangxx -### -target hexagon-unknown-elf \
    280 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    281 // RUN:   -mcpu=hexagonv60 \
    282 // RUN:   -nodefaultlibs \
    283 // RUN:   %s 2>&1 \
    284 // RUN:   | FileCheck -check-prefix=CHECK038 %s
    285 // CHECK038: "-cc1"
    286 // CHECK038-NEXT: hexagon-link
    287 // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
    288 // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
    289 // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
    290 // CHECK038: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    291 // CHECK038: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    292 // CHECK038: "{{[^"]+}}.o"
    293 // CHECK038-NOT: "-lstdc++"
    294 // CHECK038-NOT: "-lm"
    295 // CHECK038-NOT: "--start-group"
    296 // CHECK038-NOT: "-lstandalone"
    297 // CHECK038-NOT: "-lc"
    298 // CHECK038-NOT: "-lgcc"
    299 // CHECK038-NOT: "--end-group"
    300 // CHECK038: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
    301 
    302 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    303 // -moslib
    304 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    305 // RUN: %clang -### -target hexagon-unknown-elf \
    306 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    307 // RUN:   -mcpu=hexagonv60 \
    308 // RUN:   -moslib=first -moslib=second \
    309 // RUN:   %s 2>&1 \
    310 // RUN:   | FileCheck -check-prefix=CHECK039 %s
    311 // CHECK039: "-cc1"
    312 // CHECK039-NEXT: hexagon-link
    313 // CHECK039-NOT: "-static"
    314 // CHECK039-NOT: "-shared"
    315 // CHECK039-NOT: crt0_standalone.o
    316 // CHECK039: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
    317 // CHECK039: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
    318 // CHECK039: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    319 // CHECK039: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    320 // CHECK039: "{{[^"]+}}.o"
    321 // CHECK039: "--start-group"
    322 // CHECK039: "-lfirst" "-lsecond"
    323 // CHECK039-NOT: "-lstandalone"
    324 // CHECK039: "-lc" "-lgcc" "--end-group"
    325 // CHECK039: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
    326 
    327 // RUN: %clang -### -target hexagon-unknown-elf \
    328 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    329 // RUN:   -mcpu=hexagonv60 \
    330 // RUN:   -moslib=first -moslib=second -moslib=standalone \
    331 // RUN:   %s 2>&1 \
    332 // RUN:   | FileCheck -check-prefix=CHECK03A %s
    333 // CHECK03A: "-cc1"
    334 // CHECK03A-NEXT: hexagon-link
    335 // CHECK03A-NOT: "-static"
    336 // CHECK03A-NOT: "-shared"
    337 // CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
    338 // CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
    339 // CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
    340 // CHECK03A: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    341 // CHECK03A: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    342 // CHECK03A: "{{[^"]+}}.o"
    343 // CHECK03A: "--start-group"
    344 // CHECK03A: "-lfirst" "-lsecond"
    345 // CHECK03A: "-lstandalone"
    346 // CHECK03A: "-lc" "-lgcc" "--end-group"
    347 // CHECK03A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
    348 
    349 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    350 // Other args to pass to linker
    351 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    352 // RUN: %clangxx -### -target hexagon-unknown-elf \
    353 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    354 // RUN:   -mcpu=hexagonv60 \
    355 // RUN:   -s \
    356 // RUN:   -Tbss 0xdead -Tdata 0xbeef -Ttext 0xcafe \
    357 // RUN:   -t \
    358 // RUN:   -e start_here \
    359 // RUN:   -uFoo -undefined Bar \
    360 // RUN:   %s 2>&1 \
    361 // RUN:   | FileCheck -check-prefix=CHECK03B %s
    362 // CHECK03B: "-cc1"
    363 // CHECK03B-NEXT: hexagon-link
    364 // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
    365 // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
    366 // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
    367 // CHECK03B: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
    368 // CHECK03B: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
    369 // CHECK03B: "-s"
    370 // CHECK03B: "-Tbss" "0xdead" "-Tdata" "0xbeef" "-Ttext" "0xcafe"
    371 // CHECK03B: "-t"
    372 // CHECK03B: "-u" "Foo" "-undefined" "Bar"
    373 // CHECK03B: "{{[^"]+}}.o"
    374 // CHECK03B: "-lstdc++" "-lm"
    375 // CHECK03B: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
    376 // CHECK03B: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
    377 
    378 // -----------------------------------------------------------------------------
    379 // pic, small data threshold
    380 // -----------------------------------------------------------------------------
    381 // RUN: %clang -### -target hexagon-unknown-elf \
    382 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    383 // RUN:   -mcpu=hexagonv60 \
    384 // RUN:   %s 2>&1 \
    385 // RUN:   | FileCheck -check-prefix=CHECK040 %s
    386 // CHECK040:      "-cc1"
    387 // CHECK040-NEXT: hexagon-link
    388 // CHECK040-NOT:  "-G{{[0-9]+}}"
    389 
    390 // RUN: %clang -### -target hexagon-unknown-elf \
    391 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    392 // RUN:   -mcpu=hexagonv60 \
    393 // RUN:   -fpic \
    394 // RUN:   %s 2>&1 \
    395 // RUN:   | FileCheck -check-prefix=CHECK041 %s
    396 // RUN: %clang -### -target hexagon-unknown-elf \
    397 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    398 // RUN:   -mcpu=hexagonv60 \
    399 // RUN:   -fPIC \
    400 // RUN:   %s 2>&1 \
    401 // RUN:   | FileCheck -check-prefix=CHECK041 %s
    402 // CHECK041:      "-cc1"
    403 // CHECK041-NOT:  "-mrelocation-model" "static"
    404 // CHECK041:      "-pic-level" "{{[12]}}"
    405 // CHECK041:      "-mllvm" "-hexagon-small-data-threshold=0"
    406 // CHECK041-NEXT: hexagon-link
    407 // CHECK041:      "-G0"
    408 
    409 // RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \
    410 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    411 // RUN:   -mcpu=hexagonv60 \
    412 // RUN:   -G=8 \
    413 // RUN:   %s 2>&1 \
    414 // RUN:   | FileCheck -check-prefix=CHECK042 %s
    415 // RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \
    416 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    417 // RUN:   -mcpu=hexagonv60 \
    418 // RUN:   -G 8 \
    419 // RUN:   %s 2>&1 \
    420 // RUN:   | FileCheck -check-prefix=CHECK042 %s
    421 // RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as \
    422 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    423 // RUN:   -mcpu=hexagonv60 \
    424 // RUN:   -msmall-data-threshold=8 \
    425 // RUN:   %s 2>&1 \
    426 // RUN:   | FileCheck -check-prefix=CHECK042 %s
    427 // CHECK042:      "-cc1"
    428 // CHECK042:      "-mrelocation-model" "static"
    429 // CHECK042:      "-mllvm" "-hexagon-small-data-threshold=8"
    430 // CHECK042-NEXT: llvm-mc
    431 // CHECK042:      "-gpsize=8"
    432 // CHECK042-NEXT: hexagon-link
    433 // CHECK042:      "-G8"
    434 
    435 // -----------------------------------------------------------------------------
    436 // pie
    437 // -----------------------------------------------------------------------------
    438 // RUN: %clang -### -target hexagon-unknown-elf \
    439 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    440 // RUN:   -mcpu=hexagonv60 \
    441 // RUN:   -pie \
    442 // RUN:   %s 2>&1 \
    443 // RUN:   | FileCheck -check-prefix=CHECK050 %s
    444 // CHECK050:      "-cc1"
    445 // CHECK050-NEXT: hexagon-link
    446 // CHECK050:      "-pie"
    447 
    448 // RUN: %clang -### -target hexagon-unknown-elf \
    449 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    450 // RUN:   -mcpu=hexagonv60 \
    451 // RUN:   -pie -shared \
    452 // RUN:   %s 2>&1 \
    453 // RUN:   | FileCheck -check-prefix=CHECK051 %s
    454 // CHECK051:      "-cc1"
    455 // CHECK051-NEXT: hexagon-link
    456 // CHECK051-NOT:  "-pie"
    457 
    458 // -----------------------------------------------------------------------------
    459 // Test Assembler related args
    460 // -----------------------------------------------------------------------------
    461 // RUN: %clang -### -target hexagon-unknown-elf -fno-integrated-as    \
    462 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    463 // RUN:   -mcpu=hexagonv60 \
    464 // RUN:   -gdwarf-2 \
    465 // RUN:   -Wa,--noexecstack,--trap \
    466 // RUN:   -Xassembler --keep-locals \
    467 // RUN:   %s 2>&1 \
    468 // RUN:   | FileCheck -check-prefix=CHECK060 %s
    469 // CHECK060:      "-cc1"
    470 // CHECK060-NEXT: llvm-mc
    471 // CHECK060:      "--noexecstack" "--trap" "--keep-locals"
    472 // CHECK060-NEXT: hexagon-link
    473 
    474 // -----------------------------------------------------------------------------
    475 // Misc Defaults
    476 // -----------------------------------------------------------------------------
    477 // RUN: %clang -### -target hexagon-unknown-elf \
    478 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
    479 // RUN:   -mcpu=hexagonv60 \
    480 // RUN:   %s 2>&1 \
    481 // RUN:   | FileCheck -check-prefix=CHECK070 %s
    482 // CHECK070:      "-cc1"
    483 // CHECK070:      "-Wreturn-type"
    484