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