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 %s 2>&1 | FileCheck -check-prefix=CHECK000 %s
7 // CHECK000: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include"
9 // RUN: %clangxx -### --target=hexagon-unknown-elf \
10 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK001 %s
11 // CHECK001: "-cc1" {{.*}} "-internal-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include/c++"
12 // CHECK001: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include"
14 // -----------------------------------------------------------------------------
15 // Test -nostdinc, -nostdlibinc, -nostdinc++
16 // -----------------------------------------------------------------------------
18 // RUN: %clang -### --target=hexagon-unknown-elf \
19 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
20 // RUN: -nostdinc %s 2>&1 | FileCheck -check-prefix=CHECK110 %s
22 // CHECK110-NOT: "-internal-externc-isystem"
24 // RUN: %clang -### --target=hexagon-unknown-elf \
25 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
26 // RUN: -nostdlibinc %s 2>&1 | FileCheck -check-prefix=CHECK111 %s
28 // CHECK111-NOT: "-internal-externc-isystem"
30 // RUN: %clangxx -### --target=hexagon-unknown-elf \
31 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
32 // RUN: -nostdinc++ %s 2>&1 | FileCheck -check-prefix=CHECK112 %s
34 // CHECK112-NOT: "-internal-isystem"
35 // CHECK112-DAG: "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include"
37 // RUN: %clangxx -### --target=hexagon-unknown-elf -fno-integrated-as \
38 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/qc/bin \
39 // RUN: --gcc-toolchain="" \
40 // RUN: -nostdlibinc %s 2>&1 | FileCheck -check-prefix=CHECK113 %s
42 // CHECK113-NOT: "-internal-isystem"
43 // CHECK113-NOT: "-internal-externc-isystem"
45 // -----------------------------------------------------------------------------
46 // Test -mcpu=<cpuname> -mv<number>
47 // -----------------------------------------------------------------------------
48 // RUN: %clang -### --target=hexagon-unknown-elf \
49 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
50 // RUN: -mcpu=hexagonv5 %s 2>&1 | FileCheck -check-prefix=CHECK221 %s
51 // CHECK221: "-cc1" {{.*}} "-target-cpu" "hexagonv5"
52 // CHECK221: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v5/crt0
54 // RUN: %clang -### --target=hexagon-unknown-elf \
55 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
56 // RUN: -mcpu=hexagonv55 %s 2>&1 | FileCheck -check-prefix=CHECK222 %s
57 // CHECK222: "-cc1" {{.*}} "-target-cpu" "hexagonv55"
58 // CHECK222: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v55/crt0
60 // RUN: %clang -### --target=hexagon-unknown-elf \
61 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
62 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK223 %s
63 // CHECK223: "-cc1" {{.*}} "-target-cpu" "hexagonv60"
64 // CHECK223: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0
66 // RUN: %clang -### --target=hexagon-unknown-elf \
67 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
68 // RUN: -mcpu=hexagonv62 %s 2>&1 | FileCheck -check-prefix=CHECK224 %s
69 // CHECK224: "-cc1" {{.*}} "-target-cpu" "hexagonv62"
70 // CHECK224: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v62/crt0
72 // RUN: %clang -### --target=hexagon-unknown-elf \
73 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
74 // RUN: -mcpu=hexagonv65 %s 2>&1 | FileCheck -check-prefix=CHECK225 %s
75 // CHECK225: "-cc1" {{.*}} "-target-cpu" "hexagonv65"
76 // CHECK225: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v65/crt0
78 // RUN: %clang -### --target=hexagon-unknown-elf \
79 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
80 // RUN: -mcpu=hexagonv66 %s 2>&1 | FileCheck -check-prefix=CHECK226 %s
81 // CHECK226: "-cc1" {{.*}} "-target-cpu" "hexagonv66"
82 // CHECK226: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v66/crt0
84 // RUN: %clang -### --target=hexagon-unknown-elf \
85 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
86 // RUN: -O3 %s 2>&1 | FileCheck -check-prefix=CHECK227 %s
87 // CHECK227-NOT: "-ffp-contract=fast"
88 // CHECK227: {{hexagon-link|ld}}
90 // RUN: %clang -### --target=hexagon-unknown-elf \
91 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
92 // RUN: -O3 -ffp-contract=off %s 2>&1 | FileCheck -check-prefix=CHECK228 %s
93 // CHECK228-NOT: "-ffp-contract=fast"
94 // CHECK228: {{hexagon-link|ld}}
96 // RUN: not %clang -### --target=hexagon-unknown-elf \
97 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
98 // RUN: -mcpu=hexagonv65 -march=hexagon\
99 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK229 %s
100 // RUN: not %clang -### --target=hexagon-unknown-elf \
101 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
102 // RUN: -mv65 -march=hexagon\
103 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK229 %s
104 // CHECK229: "-cc1" {{.*}} "-target-cpu" "hexagonv65"
105 // CHECK229: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v65/crt0
107 // RUN: not %clang -### --target=hexagon-unknown-elf \
108 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
109 // RUN: -mcpu=hexagonv67 -fuse-ld=hexagon-link \
110 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK22A %s
111 // CHECK22A: "-cc1" {{.*}} "-target-cpu" "hexagonv67"
112 // CHECK22A: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v67/crt0
114 // RUN: not %clang -### --target=hexagon-unknown-elf \
115 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
116 // RUN: -mcpu=hexagonv67t \
117 // RUN: -fuse-ld=fake-value-to-ignore-CLANG_DEFAULT_LINKER %s 2>&1 | FileCheck -check-prefix=CHECK22B %s
118 // CHECK22B: "-cc1" {{.*}} "-target-cpu" "hexagonv67t"
119 // CHECK22B: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v67t/crt0
121 // RUN: not %clang -### --target=hexagon-unknown-elf \
122 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
123 // RUN: -mcpu=hexagonv68 -fuse-ld=hexagon-link \
124 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK22C %s
125 // CHECK22C: "-cc1" {{.*}} "-target-cpu" "hexagonv68"
126 // CHECK22C: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v68/crt0
128 // RUN: not %clang -### --target=hexagon-unknown-elf \
129 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
130 // RUN: -mcpu=hexagonv69 -fuse-ld=hexagon-link \
131 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK22D %s
132 // CHECK22D: "-cc1" {{.*}} "-target-cpu" "hexagonv69"
133 // CHECK22D: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v69/crt0
135 // RUN: not %clang -### --target=hexagon-unknown-elf \
136 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
137 // RUN: -mcpu=hexagonv71 -fuse-ld=hexagon-link \
138 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK22E %s
139 // CHECK22E: "-cc1" {{.*}} "-target-cpu" "hexagonv71"
140 // CHECK22E: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v71/crt0
142 // RUN: not %clang -### --target=hexagon-unknown-elf \
143 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
144 // RUN: -mcpu=hexagonv71t -fuse-ld=hexagon-link \
145 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK22F %s
146 // CHECK22F: "-cc1" {{.*}} "-target-cpu" "hexagonv71t"
147 // CHECK22F: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v71t/crt0
149 // RUN: not %clang -### --target=hexagon-unknown-elf \
150 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
151 // RUN: -mcpu=hexagonv73 -fuse-ld=hexagon-link \
152 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK230 %s
153 // CHECK230: "-cc1" {{.*}} "-target-cpu" "hexagonv73"
154 // CHECK230: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v73/crt0
156 // -----------------------------------------------------------------------------
157 // Test Linker related args
158 // -----------------------------------------------------------------------------
160 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
162 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
163 // RUN: %clang -### --target=hexagon-unknown-elf \
164 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
165 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK330 %s
167 // CHECK330: {{hexagon-link|ld}}
168 // CHECK330-NOT: "-static"
169 // CHECK330-NOT: "-shared"
170 // CHECK330: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
171 // CHECK330: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
172 // CHECK330: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
173 // CHECK330: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
174 // CHECK330: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
175 // CHECK330: "{{[^"]+}}.o"
176 // CHECK330: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
177 // CHECK330: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
179 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
181 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
182 // RUN: %clangxx -### --target=hexagon-unknown-elf \
183 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
184 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK331 %s
186 // CHECK331: {{hexagon-link|ld}}
187 // CHECK331-NOT: "-static"
188 // CHECK331-NOT: "-shared"
189 // CHECK331: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
190 // CHECK331-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
191 // CHECK331-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
192 // CHECK331-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
193 // CHECK331-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
194 // CHECK331-SAME: "{{[^"]+}}.o"
195 // CHECK331-SAME: "-lstdc++" "-lm" "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
196 // CHECK331-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
198 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
199 // Additional Libraries (-L)
200 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
201 // RUN: %clang -### --target=hexagon-unknown-elf \
202 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
203 // RUN: -mcpu=hexagonv60 \
204 // RUN: -Lone -L two -L three %s 2>&1 | FileCheck -check-prefix=CHECK332 %s
206 // CHECK332: {{hexagon-link|ld}}
207 // CHECK332-NOT: "-static"
208 // CHECK332-NOT: "-shared"
209 // CHECK332: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
210 // CHECK332: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
211 // CHECK332: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
212 // CHECK332: "-Lone" "-Ltwo" "-Lthree"
213 // CHECK332: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
214 // CHECK332: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
215 // CHECK332: "{{[^"]+}}.o"
216 // CHECK332: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
217 // CHECK332: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
219 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
221 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
222 // RUN: %clang -### --target=hexagon-unknown-elf \
223 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
224 // RUN: -mcpu=hexagonv60 \
225 // RUN: -static %s 2>&1 | FileCheck -check-prefix=CHECK333 %s
227 // CHECK333: {{hexagon-link|ld}}
228 // CHECK333: "-static"
229 // CHECK333: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
230 // CHECK333: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
231 // CHECK333: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
232 // CHECK333: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
233 // CHECK333: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
234 // CHECK333: "{{[^"]+}}.o"
235 // CHECK333: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
236 // CHECK333: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
238 // RUN: %clang -### --target=hexagon-unknown-elf \
239 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
240 // RUN: -mcpu=hexagonv60 \
241 // RUN: -shared %s 2>&1 | FileCheck -check-prefix=CHECK334 %s
243 // CHECK334: {{hexagon-link|ld}}
244 // CHECK334: "-shared" "-call_shared"
245 // CHECK334-NOT: crt0_standalone.o
246 // CHECK334-NOT: crt0.o
247 // CHECK334: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/pic/initS.o"
248 // CHECK334: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0"
249 // CHECK334: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
250 // CHECK334: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
251 // CHECK334: "{{[^"]+}}.o"
252 // CHECK334: "--start-group"
253 // CHECK334-NOT: "-lstandalone"
254 // CHECK334-NOT: "-lc"
256 // CHECK334: "--end-group"
257 // CHECK334: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/pic/finiS.o"
259 // RUN: %clang -### --target=hexagon-unknown-elf \
260 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
261 // RUN: -mcpu=hexagonv60 \
263 // RUN: -static %s 2>&1 | FileCheck -check-prefix=CHECK335 %s
265 // CHECK335: {{hexagon-link|ld}}
266 // CHECK335: "-shared" "-call_shared" "-static"
267 // CHECK335-NOT: crt0_standalone.o
268 // CHECK335-NOT: crt0.o
269 // CHECK335: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/init.o"
270 // CHECK335-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0"
271 // CHECK335-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
272 // CHECK335-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
273 // CHECK335-SAME: "{{[^"]+}}.o"
274 // CHECK335-SAME: "--start-group"
275 // CHECK335-NOT: "-lstandalone"
276 // CHECK335-NOT: "-lc"
277 // CHECK335-SAME: "-lgcc" "--end-group"
278 // CHECK335-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/fini.o"
280 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
281 // -nostdlib, -nostartfiles, -nodefaultlibs, -nolibc
282 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
283 // RUN: %clangxx -### --target=hexagon-unknown-elf \
284 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
285 // RUN: -mcpu=hexagonv60 \
286 // RUN: -nostdlib %s 2>&1 | FileCheck -check-prefix=CHECK336 %s
288 // CHECK336: {{hexagon-link|ld}}
289 // CHECK336-NOT: crt0_standalone.o
290 // CHECK336-NOT: crt0.o
291 // CHECK336-NOT: init.o
292 // CHECK336: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
293 // CHECK336: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
294 // CHECK336: "{{[^"]+}}.o"
295 // CHECK336-NOT: "-lstdc++"
296 // CHECK336-NOT: "-lm"
297 // CHECK336-NOT: "--start-group"
298 // CHECK336-NOT: "-lstandalone"
299 // CHECK336-NOT: "-lc"
300 // CHECK336-NOT: "-lgcc"
301 // CHECK336-NOT: "--end-group"
302 // CHECK336-NOT: fini.o
304 // RUN: %clangxx -### --target=hexagon-unknown-elf \
305 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
306 // RUN: -mcpu=hexagonv60 \
307 // RUN: -nostartfiles %s 2>&1 | FileCheck -check-prefix=CHECK337 %s
309 // CHECK337: {{hexagon-link|ld}}
310 // CHECK337-NOT: crt0_standalone.o
311 // CHECK337-NOT: crt0.o
312 // CHECK337-NOT: init.o
313 // CHECK337: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
314 // CHECK337: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
315 // CHECK337: "{{[^"]+}}.o"
316 // CHECK337: "-lstdc++" "-lm" "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
317 // CHECK337-NOT: fini.o
319 // RUN: %clangxx -### --target=hexagon-unknown-elf \
320 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
321 // RUN: -mcpu=hexagonv60 \
322 // RUN: -nodefaultlibs %s 2>&1 | FileCheck -check-prefix=CHECK338 %s
324 // CHECK338: {{hexagon-link|ld}}
325 // CHECK338: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
326 // CHECK338: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
327 // CHECK338: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
328 // CHECK338: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
329 // CHECK338: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
330 // CHECK338: "{{[^"]+}}.o"
331 // CHECK338-NOT: "-lstdc++"
332 // CHECK338-NOT: "-lm"
333 // CHECK338-NOT: "--start-group"
334 // CHECK338-NOT: "-lstandalone"
335 // CHECK338-NOT: "-lc"
336 // CHECK338-NOT: "-lgcc"
337 // CHECK338-NOT: "--end-group"
338 // CHECK338: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
340 // RUN: %clangxx -### --target=hexagon-unknown-elf \
341 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin -mcpu=hexagonv60 \
342 // RUN: -fuse-ld=lld -nolibc %s 2>&1 | FileCheck -check-prefix=CHECK-NOLIBC %s
343 // CHECK-NOLIBC: "-cc1"
344 // CHECK-NOLIBC: ld.lld
345 // CHECK-NOLIBC-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
346 // CHECK-NOLIBC-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
347 // CHECK-NOLIBC-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
348 // CHECK-NOLIBC-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
349 // CHECK-NOLIBC-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
350 // CHECK-NOLIBC-SAME: "{{[^"]+}}.o"
351 // CHECK-NOLIBC-SAME: "-lstdc++"
352 // CHECK-NOLIBC-SAME: "-lm"
353 // CHECK-NOLIBC-SAME: "--start-group"
354 // CHECK-NOLIBC-SAME: "-lstandalone"
355 // CHECK-NOLIBC-NOT: "-lc"
356 // CHECK-NOLIBC-SAME: "-lgcc"
357 // CHECK-NOLIBC-SAME: "--end-group"
358 // CHECK-NOLIBC-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
361 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
363 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
364 // RUN: %clang -### --target=hexagon-unknown-elf \
365 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
366 // RUN: -mcpu=hexagonv60 \
367 // RUN: -moslib=first -moslib=second %s 2>&1 | FileCheck -check-prefix=CHECK339 %s
369 // CHECK339: {{hexagon-link|ld}}
370 // CHECK339-NOT: "-static"
371 // CHECK339-NOT: "-shared"
372 // CHECK339-NOT: crt0_standalone.o
373 // CHECK339: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
374 // CHECK339-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
375 // CHECK339-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
376 // CHECK339-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
377 // CHECK339-SAME: "{{[^"]+}}.o"
378 // CHECK339-SAME: "--start-group" "-lfirst" "-lsecond"
379 // CHECK339-NOT: "-lstandalone"
380 // CHECK339-SAME: "-lc" "-lgcc" "--end-group"
381 // CHECK339-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
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 -moslib=standalone %s 2>&1 | FileCheck -check-prefix=CHECK33A %s
388 // CHECK33A: {{hexagon-link|ld}}
389 // CHECK33A-NOT: "-static"
390 // CHECK33A-NOT: "-shared"
391 // CHECK33A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
392 // CHECK33A-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
393 // CHECK33A-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
394 // CHECK33A-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
395 // CHECK33A-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
396 // CHECK33A-SAME: "{{[^"]+}}.o"
397 // CHECK33A-SAME: "--start-group"
398 // CHECK33A-SAME: "-lfirst" "-lsecond"
399 // CHECK33A-SAME: "-lstandalone"
400 // CHECK33A-SAME: "-lc" "-lgcc" "--end-group"
401 // CHECK33A-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
403 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
404 // Other args to pass to linker
405 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
406 // RUN: %clangxx -### --target=hexagon-unknown-elf \
407 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
408 // RUN: -mcpu=hexagonv60 -fuse-ld=lld \
409 // RUN: -s -t -e start_here -uFoo -undefined Bar %s 2>&1 | FileCheck -check-prefix=CHECK33B %s
412 // CHECK33B-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
413 // CHECK33B-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
414 // CHECK33B-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
415 // CHECK33B-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
416 // CHECK33B-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
417 // CHECK33B-SAME: "-s" "-t" "-u" "Foo" "-undefined" "Bar"
418 // CHECK33B-SAME: "{{[^"]+}}.o"
419 // CHECK33B-SAME: "-lstdc++" "-lm" "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
420 // CHECK33B-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
422 // -----------------------------------------------------------------------------
423 // pic, small data threshold
424 // -----------------------------------------------------------------------------
425 // RUN: %clang -### --target=hexagon-unknown-elf \
426 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
427 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK340 %s
429 // CHECK340: {{hexagon-link|ld}}
430 // CHECK340-NOT: "-G{{[0-9]+}}"
432 // RUN: %clang -### --target=hexagon-unknown-elf \
433 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
434 // RUN: -mcpu=hexagonv60 \
435 // RUN: -fpic %s 2>&1 | FileCheck -check-prefix=CHECK341 %s
436 // RUN: %clang -### --target=hexagon-unknown-elf \
437 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
438 // RUN: -mcpu=hexagonv60 \
439 // RUN: -fPIC %s 2>&1 | FileCheck -check-prefix=CHECK341 %s
441 // CHECK341-NOT: "-mrelocation-model" "static"
442 // CHECK341: "-pic-level" "{{[12]}}"
443 // CHECK341: "-mllvm" "-hexagon-small-data-threshold=0"
444 // CHECK341: {{hexagon-link|ld}}
447 // RUN: %clang -### --target=hexagon-unknown-elf -fno-integrated-as -fno-pie -no-pie \
448 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
449 // RUN: -mcpu=hexagonv60 \
450 // RUN: -G=8 %s 2>&1 | FileCheck -check-prefix=CHECK342 %s
451 // RUN: %clang -### --target=hexagon-unknown-elf -fno-integrated-as -fno-pie -no-pie \
452 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
453 // RUN: -mcpu=hexagonv60 \
454 // RUN: -G 8 %s 2>&1 | FileCheck -check-prefix=CHECK342 %s
455 // RUN: %clang -### --target=hexagon-unknown-elf -fno-integrated-as -fno-pie -no-pie \
456 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
457 // RUN: -mcpu=hexagonv60 \
458 // RUN: -msmall-data-threshold=8 %s 2>&1 | FileCheck -check-prefix=CHECK342 %s
460 // CHECK342: "-mrelocation-model" "static"
461 // CHECK342: "-mllvm" "-hexagon-small-data-threshold=8"
462 // CHECK342-NEXT: llvm-mc
463 // CHECK342: "-gpsize=8"
464 // CHECK342: {{hexagon-link|ld}}
467 // -----------------------------------------------------------------------------
469 // -----------------------------------------------------------------------------
470 // RUN: %clang -### --target=hexagon-unknown-elf \
471 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
472 // RUN: -mcpu=hexagonv60 \
473 // RUN: -pie %s 2>&1 | FileCheck -check-prefix=CHECK350 %s
475 // CHECK350: {{hexagon-link|ld}}
478 // RUN: %clang -### --target=hexagon-unknown-elf \
479 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
480 // RUN: -mcpu=hexagonv60 \
481 // RUN: -pie -shared %s 2>&1 | FileCheck -check-prefix=CHECK351 %s
483 // CHECK351: {{hexagon-link|ld}}
484 // CHECK351-NOT: "-pie"
486 // -----------------------------------------------------------------------------
487 // Test Assembler related args
488 // -----------------------------------------------------------------------------
489 // RUN: %clang -### --target=hexagon-unknown-elf -fno-integrated-as \
490 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
491 // RUN: -mcpu=hexagonv60 \
493 // RUN: -Wa,--noexecstack,--trap \
494 // RUN: -Xassembler --keep-locals %s 2>&1 | FileCheck -check-prefix=CHECK360 %s
496 // CHECK360-NEXT: llvm-mc
497 // CHECK360: "--noexecstack" "--trap" "--keep-locals"
498 // CHECK360: {{hexagon-link|ld}}
500 // -----------------------------------------------------------------------------
502 // -----------------------------------------------------------------------------
503 // RUN: %clang -### --target=hexagon-unknown-elf -ffixed-r19 %s 2>&1 \
504 // RUN: | FileCheck --check-prefix=CHECK370 %s
505 // CHECK370: "-target-feature" "+reserved-r19"
506 // RUN: %clang -### --target=hexagon-unknown-elf %s 2>&1 \
507 // RUN: | FileCheck --check-prefix=CHECK371 %s
508 // CHECK371-NOT: "+reserved-r19"
510 // -----------------------------------------------------------------------------
512 // -----------------------------------------------------------------------------
513 // RUN: %clang -### --target=hexagon-unknown-elf -mcabac %s 2>&1 \
514 // RUN: | FileCheck --check-prefix=CHECK372 %s
515 // CHECK372: "-target-feature" "+cabac"
516 // RUN: %clang -### --target=hexagon-unknown-elf %s 2>&1 \
517 // RUN: | FileCheck --check-prefix=CHECK373 %s
518 // CHECK373-NOT: "+cabac"
520 // -----------------------------------------------------------------------------
522 // -----------------------------------------------------------------------------
523 // RUN: %clang -### --target=hexagon-unknown-elf \
524 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
525 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK380 %s
527 // CHECK380-SAME: "-Wreturn-type"
529 // -----------------------------------------------------------------------------
530 // Default, hexagon-link is used
531 // -----------------------------------------------------------------------------
532 // RUN: not %clang -### --target=hexagon-unknown-elf \
533 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
534 // RUN: -mcpu=hexagonv60 \
535 // RUN: -fuse-ld=fake-value-to-ignore-CLANG_DEFAULT_LINKER %s 2>&1 | FileCheck -check-prefix=CHECK381 %s
536 // REQUIRES: hexagon-registered-target
537 // CHECK381: "-march=hexagon"
538 // CHECK381: "-mcpu=hexagonv60"
539 // -----------------------------------------------------------------------------
540 // Passing -fuse-ld=lld
541 // -----------------------------------------------------------------------------
542 // RUN: %clang -### --target=hexagon-unknown-elf \
543 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
544 // RUN: -mcpu=hexagonv60 \
545 // RUN: -fuse-ld=lld %s 2>&1 | FileCheck -check-prefix=CHECK382 %s
546 // CHECK382-NOT: "-march=
547 // CHECK382-NOT: "-mcpu=
548 // -----------------------------------------------------------------------------
550 // -----------------------------------------------------------------------------
551 // RUN: %clang -### --target=hexagon-unknown-elf \
552 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
553 // RUN: -mcpu=hexagonv60 \
554 // RUN: --sysroot=/hexagon %s 2>&1 | FileCheck -check-prefix=CHECK383 %s
555 // CHECK383: "-isysroot" "/hexagon"
556 // CHECK383: "-internal-externc-isystem" "/hexagon{{/|\\\\}}include"
557 // -----------------------------------------------------------------------------
558 // Passing -fno-use-init-array
559 // -----------------------------------------------------------------------------
560 // RUN: %clang -### --target=hexagon-unknown-elf \
561 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
562 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK384 %s
563 // CHECK384: "-fno-use-init-array"