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