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