Debian Codegraph @

clang/test/Driver/hexagon-toolchain-elf.c

raw
1 // -----------------------------------------------------------------------------
2 // Test standard include paths
3 // -----------------------------------------------------------------------------
4
5 // RUN: %clang -### --target=hexagon-unknown-elf \
6 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK000 %s
7 // CHECK000: "-cc1" {{.*}} "-internal-externc-isystem" "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/include"
8
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"
13
14 // -----------------------------------------------------------------------------
15 // Test -nostdinc, -nostdlibinc, -nostdinc++
16 // -----------------------------------------------------------------------------
17
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"
23
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"
29
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"
36
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"
43
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
52
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
58
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
64
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
70
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
76
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
82
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}}
88
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}}
94
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
105
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
112
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
119
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
126
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
133
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
140
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
147
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
154
155 // RUN: not %clang -### --target=hexagon-unknown-elf \
156 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
157 // RUN: -mcpu=hexagonv75 -fuse-ld=hexagon-link \
158 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK240 %s
159 // CHECK240: "-cc1" {{.*}} "-target-cpu" "hexagonv75"
160 // CHECK240: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v75/crt0
161
162 // RUN: not %clang -### --target=hexagon-unknown-elf \
163 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
164 // RUN: -mcpu=hexagonv79 -fuse-ld=hexagon-link \
165 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK250 %s
166 // CHECK250: "-cc1" {{.*}} "-target-cpu" "hexagonv79"
167 // CHECK250: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v79/crt0
168
169 // RUN: not %clang -### --target=hexagon-unknown-elf \
170 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
171 // RUN: -mcpu=hexagonv81 -fuse-ld=hexagon-link \
172 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK260 %s
173 // CHECK260: "-cc1" {{.*}} "-target-cpu" "hexagonv81"
174 // CHECK260: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v81/crt0
175
176 // -----------------------------------------------------------------------------
177 // Test Linker related args
178 // -----------------------------------------------------------------------------
179
180 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
181 // Defaults for C
182 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
183 // RUN: %clang -### --target=hexagon-unknown-elf \
184 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
185 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK330 %s
186 // CHECK330: "-cc1"
187 // CHECK330: {{hexagon-link|ld}}
188 // CHECK330-NOT: "-static"
189 // CHECK330-NOT: "-shared"
190 // CHECK330: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
191 // CHECK330: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
192 // CHECK330: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
193 // CHECK330: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
194 // CHECK330: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
195 // CHECK330: "{{[^"]+}}.o"
196 // CHECK330: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
197 // CHECK330: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
198
199 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
200 // Defaults for C++
201 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
202 // RUN: %clangxx -### --target=hexagon-unknown-elf \
203 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
204 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK331 %s
205 // CHECK331: "-cc1"
206 // CHECK331: {{hexagon-link|ld}}
207 // CHECK331-NOT: "-static"
208 // CHECK331-NOT: "-shared"
209 // CHECK331: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
210 // CHECK331-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
211 // CHECK331-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
212 // CHECK331-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
213 // CHECK331-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
214 // CHECK331-SAME: "{{[^"]+}}.o"
215 // CHECK331-SAME: "-lstdc++" "-lm" "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
216 // CHECK331-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
217
218 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
219 // Additional Libraries (-L)
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: -Lone -L two -L three %s 2>&1 | FileCheck -check-prefix=CHECK332 %s
225 // CHECK332: "-cc1"
226 // CHECK332: {{hexagon-link|ld}}
227 // CHECK332-NOT: "-static"
228 // CHECK332-NOT: "-shared"
229 // CHECK332: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
230 // CHECK332: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
231 // CHECK332: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
232 // CHECK332: "-Lone" "-Ltwo" "-Lthree"
233 // CHECK332: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
234 // CHECK332: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
235 // CHECK332: "{{[^"]+}}.o"
236 // CHECK332: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
237 // CHECK332: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
238
239 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
240 // -static, -shared
241 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
242 // RUN: %clang -### --target=hexagon-unknown-elf \
243 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
244 // RUN: -mcpu=hexagonv60 \
245 // RUN: -static %s 2>&1 | FileCheck -check-prefix=CHECK333 %s
246 // CHECK333: "-cc1"
247 // CHECK333: {{hexagon-link|ld}}
248 // CHECK333: "-static"
249 // CHECK333: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
250 // CHECK333: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
251 // CHECK333: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
252 // CHECK333: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
253 // CHECK333: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
254 // CHECK333: "{{[^"]+}}.o"
255 // CHECK333: "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
256 // CHECK333: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
257
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 %s 2>&1 | FileCheck -check-prefix=CHECK334 %s
262 // CHECK334: "-cc1"
263 // CHECK334: {{hexagon-link|ld}}
264 // CHECK334: "-shared" "-call_shared"
265 // CHECK334-NOT: crt0_standalone.o
266 // CHECK334-NOT: crt0.o
267 // CHECK334: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/pic/initS.o"
268 // CHECK334: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0"
269 // CHECK334: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
270 // CHECK334: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
271 // CHECK334: "{{[^"]+}}.o"
272 // CHECK334: "--start-group"
273 // CHECK334-NOT: "-lstandalone"
274 // CHECK334-NOT: "-lc"
275 // CHECK334: "-lgcc"
276 // CHECK334: "--end-group"
277 // CHECK334: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/pic/finiS.o"
278
279 // RUN: %clang -### --target=hexagon-unknown-elf \
280 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
281 // RUN: -mcpu=hexagonv60 \
282 // RUN: -shared \
283 // RUN: -static %s 2>&1 | FileCheck -check-prefix=CHECK335 %s
284 // CHECK335: "-cc1"
285 // CHECK335: {{hexagon-link|ld}}
286 // CHECK335: "-shared" "-call_shared" "-static"
287 // CHECK335-NOT: crt0_standalone.o
288 // CHECK335-NOT: crt0.o
289 // CHECK335: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/init.o"
290 // CHECK335-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0"
291 // CHECK335-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
292 // CHECK335-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
293 // CHECK335-SAME: "{{[^"]+}}.o"
294 // CHECK335-SAME: "--start-group"
295 // CHECK335-NOT: "-lstandalone"
296 // CHECK335-NOT: "-lc"
297 // CHECK335-SAME: "-lgcc" "--end-group"
298 // CHECK335-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/G0/fini.o"
299
300 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
301 // -nostdlib, -nostartfiles, -nodefaultlibs, -nolibc
302 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
303 // RUN: %clangxx -### --target=hexagon-unknown-elf \
304 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
305 // RUN: -mcpu=hexagonv60 \
306 // RUN: -nostdlib %s 2>&1 | FileCheck -check-prefix=CHECK336 %s
307 // CHECK336: "-cc1"
308 // CHECK336: {{hexagon-link|ld}}
309 // CHECK336-NOT: crt0_standalone.o
310 // CHECK336-NOT: crt0.o
311 // CHECK336-NOT: init.o
312 // CHECK336: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
313 // CHECK336: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
314 // CHECK336: "{{[^"]+}}.o"
315 // CHECK336-NOT: "-lstdc++"
316 // CHECK336-NOT: "-lm"
317 // CHECK336-NOT: "--start-group"
318 // CHECK336-NOT: "-lstandalone"
319 // CHECK336-NOT: "-lc"
320 // CHECK336-NOT: "-lgcc"
321 // CHECK336-NOT: "--end-group"
322 // CHECK336-NOT: fini.o
323
324 // RUN: %clangxx -### --target=hexagon-unknown-elf \
325 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
326 // RUN: -mcpu=hexagonv60 \
327 // RUN: -nostartfiles %s 2>&1 | FileCheck -check-prefix=CHECK337 %s
328 // CHECK337: "-cc1"
329 // CHECK337: {{hexagon-link|ld}}
330 // CHECK337-NOT: crt0_standalone.o
331 // CHECK337-NOT: crt0.o
332 // CHECK337-NOT: init.o
333 // CHECK337: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
334 // CHECK337: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
335 // CHECK337: "{{[^"]+}}.o"
336 // CHECK337: "-lstdc++" "-lm" "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
337 // CHECK337-NOT: fini.o
338
339 // RUN: %clangxx -### --target=hexagon-unknown-elf \
340 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
341 // RUN: -mcpu=hexagonv60 \
342 // RUN: -nodefaultlibs %s 2>&1 | FileCheck -check-prefix=CHECK338 %s
343 // CHECK338: "-cc1"
344 // CHECK338: {{hexagon-link|ld}}
345 // CHECK338: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
346 // CHECK338: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
347 // CHECK338: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
348 // CHECK338: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
349 // CHECK338: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
350 // CHECK338: "{{[^"]+}}.o"
351 // CHECK338-NOT: "-lstdc++"
352 // CHECK338-NOT: "-lm"
353 // CHECK338-NOT: "--start-group"
354 // CHECK338-NOT: "-lstandalone"
355 // CHECK338-NOT: "-lc"
356 // CHECK338-NOT: "-lgcc"
357 // CHECK338-NOT: "--end-group"
358 // CHECK338: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
359
360 // RUN: %clangxx -### --target=hexagon-unknown-elf \
361 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin -mcpu=hexagonv60 \
362 // RUN: -fuse-ld=lld -nolibc %s 2>&1 | FileCheck -check-prefix=CHECK-NOLIBC %s
363 // CHECK-NOLIBC: "-cc1"
364 // CHECK-NOLIBC: ld.lld
365 // CHECK-NOLIBC-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
366 // CHECK-NOLIBC-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
367 // CHECK-NOLIBC-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
368 // CHECK-NOLIBC-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
369 // CHECK-NOLIBC-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
370 // CHECK-NOLIBC-SAME: "{{[^"]+}}.o"
371 // CHECK-NOLIBC-SAME: "-lstdc++"
372 // CHECK-NOLIBC-SAME: "-lm"
373 // CHECK-NOLIBC-SAME: "--start-group"
374 // CHECK-NOLIBC-SAME: "-lstandalone"
375 // CHECK-NOLIBC-NOT: "-lc"
376 // CHECK-NOLIBC-SAME: "-lgcc"
377 // CHECK-NOLIBC-SAME: "--end-group"
378 // CHECK-NOLIBC-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
379
380
381 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
382 // -moslib
383 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
384 // RUN: %clang -### --target=hexagon-unknown-elf \
385 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
386 // RUN: -mcpu=hexagonv60 \
387 // RUN: -moslib=first -moslib=second %s 2>&1 | FileCheck -check-prefix=CHECK339 %s
388 // CHECK339: "-cc1"
389 // CHECK339: {{hexagon-link|ld}}
390 // CHECK339-NOT: "-static"
391 // CHECK339-NOT: "-shared"
392 // CHECK339-NOT: crt0_standalone.o
393 // CHECK339: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
394 // CHECK339-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
395 // CHECK339-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
396 // CHECK339-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
397 // CHECK339-SAME: "{{[^"]+}}.o"
398 // CHECK339-SAME: "--start-group" "-lfirst" "-lsecond"
399 // CHECK339-NOT: "-lstandalone"
400 // CHECK339-SAME: "-lc" "-lgcc" "--end-group"
401 // CHECK339-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
402
403 // RUN: %clang -### --target=hexagon-unknown-elf \
404 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
405 // RUN: -mcpu=hexagonv60 \
406 // RUN: -moslib=first -moslib=second -moslib=standalone %s 2>&1 | FileCheck -check-prefix=CHECK33A %s
407 // CHECK33A: "-cc1"
408 // CHECK33A: {{hexagon-link|ld}}
409 // CHECK33A-NOT: "-static"
410 // CHECK33A-NOT: "-shared"
411 // CHECK33A: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
412 // CHECK33A-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
413 // CHECK33A-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
414 // CHECK33A-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
415 // CHECK33A-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
416 // CHECK33A-SAME: "{{[^"]+}}.o"
417 // CHECK33A-SAME: "--start-group"
418 // CHECK33A-SAME: "-lfirst" "-lsecond"
419 // CHECK33A-SAME: "-lstandalone"
420 // CHECK33A-SAME: "-lc" "-lgcc" "--end-group"
421 // CHECK33A-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
422
423 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
424 // Other args to pass to linker
425 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
426 // RUN: %clangxx -### --target=hexagon-unknown-elf \
427 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
428 // RUN: -mcpu=hexagonv60 -fuse-ld=lld \
429 // RUN: -s -t -e start_here -uFoo -undefined Bar %s 2>&1 | FileCheck -check-prefix=CHECK33B %s
430 // CHECK33B: "-cc1"
431 // CHECK33B: ld.lld
432 // CHECK33B-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0_standalone.o"
433 // CHECK33B-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/crt0.o"
434 // CHECK33B-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/init.o"
435 // CHECK33B-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60"
436 // CHECK33B-SAME: "-L{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib"
437 // CHECK33B-SAME: "-s" "-t" "-u" "Foo" "-undefined" "Bar"
438 // CHECK33B-SAME: "{{[^"]+}}.o"
439 // CHECK33B-SAME: "-lstdc++" "-lm" "--start-group" "-lstandalone" "-lc" "-lgcc" "--end-group"
440 // CHECK33B-SAME: "{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v60/fini.o"
441
442 // -----------------------------------------------------------------------------
443 // pic, small data threshold
444 // -----------------------------------------------------------------------------
445 // RUN: %clang -### --target=hexagon-unknown-elf \
446 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
447 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK340 %s
448 // CHECK340: "-cc1"
449 // CHECK340: {{hexagon-link|ld}}
450 // CHECK340-NOT: "-G{{[0-9]+}}"
451
452 // RUN: %clang -### --target=hexagon-unknown-elf \
453 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
454 // RUN: -mcpu=hexagonv60 \
455 // RUN: -fpic %s 2>&1 | FileCheck -check-prefix=CHECK341 %s
456 // RUN: %clang -### --target=hexagon-unknown-elf \
457 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
458 // RUN: -mcpu=hexagonv60 \
459 // RUN: -fPIC %s 2>&1 | FileCheck -check-prefix=CHECK341 %s
460 // CHECK341: "-cc1"
461 // CHECK341-NOT: "-mrelocation-model" "static"
462 // CHECK341: "-pic-level" "{{[12]}}"
463 // CHECK341: "-mllvm" "-hexagon-small-data-threshold=0"
464 // CHECK341: {{hexagon-link|ld}}
465 // CHECK341: "-G0"
466
467 // RUN: %clang -### --target=hexagon-unknown-elf -fno-integrated-as -fno-pie -no-pie \
468 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
469 // RUN: -mcpu=hexagonv60 \
470 // RUN: -G=8 %s 2>&1 | FileCheck -check-prefix=CHECK342 %s
471 // RUN: %clang -### --target=hexagon-unknown-elf -fno-integrated-as -fno-pie -no-pie \
472 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
473 // RUN: -mcpu=hexagonv60 \
474 // RUN: -G 8 %s 2>&1 | FileCheck -check-prefix=CHECK342 %s
475 // RUN: %clang -### --target=hexagon-unknown-elf -fno-integrated-as -fno-pie -no-pie \
476 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
477 // RUN: -mcpu=hexagonv60 \
478 // RUN: -msmall-data-threshold=8 %s 2>&1 | FileCheck -check-prefix=CHECK342 %s
479 // CHECK342: "-cc1"
480 // CHECK342: "-mrelocation-model" "static"
481 // CHECK342: "-mllvm" "-hexagon-small-data-threshold=8"
482 // CHECK342-NEXT: llvm-mc
483 // CHECK342: "-gpsize=8"
484 // CHECK342: {{hexagon-link|ld}}
485 // CHECK342: "-G8"
486
487 // -----------------------------------------------------------------------------
488 // pie
489 // -----------------------------------------------------------------------------
490 // RUN: %clang -### --target=hexagon-unknown-elf \
491 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
492 // RUN: -mcpu=hexagonv60 \
493 // RUN: -pie %s 2>&1 | FileCheck -check-prefix=CHECK350 %s
494 // CHECK350: "-cc1"
495 // CHECK350: {{hexagon-link|ld}}
496 // CHECK350: "-pie"
497
498 // RUN: %clang -### --target=hexagon-unknown-elf \
499 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
500 // RUN: -mcpu=hexagonv60 \
501 // RUN: -pie -shared %s 2>&1 | FileCheck -check-prefix=CHECK351 %s
502 // CHECK351: "-cc1"
503 // CHECK351: {{hexagon-link|ld}}
504 // CHECK351-NOT: "-pie"
505
506 // -----------------------------------------------------------------------------
507 // Test Assembler related args
508 // -----------------------------------------------------------------------------
509 // RUN: %clang -### --target=hexagon-unknown-elf -fno-integrated-as \
510 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
511 // RUN: -mcpu=hexagonv60 \
512 // RUN: -gdwarf-2 \
513 // RUN: -Wa,--noexecstack,--trap \
514 // RUN: -Xassembler --keep-locals %s 2>&1 | FileCheck -check-prefix=CHECK360 %s
515 // CHECK360: "-cc1"
516 // CHECK360-NEXT: llvm-mc
517 // CHECK360: "--noexecstack" "--trap" "--keep-locals"
518 // CHECK360: {{hexagon-link|ld}}
519
520 // -----------------------------------------------------------------------------
521 // ffixed-r19
522 // -----------------------------------------------------------------------------
523 // RUN: %clang -### --target=hexagon-unknown-elf -ffixed-r19 %s 2>&1 \
524 // RUN: | FileCheck --check-prefix=CHECK370 %s
525 // CHECK370: "-target-feature" "+reserved-r19"
526 // RUN: %clang -### --target=hexagon-unknown-elf %s 2>&1 \
527 // RUN: | FileCheck --check-prefix=CHECK371 %s
528 // CHECK371-NOT: "+reserved-r19"
529
530 // -----------------------------------------------------------------------------
531 // mcabac
532 // -----------------------------------------------------------------------------
533 // RUN: %clang -### --target=hexagon-unknown-elf -mcabac %s 2>&1 \
534 // RUN: | FileCheck --check-prefix=CHECK372 %s
535 // CHECK372: "-target-feature" "+cabac"
536 // RUN: %clang -### --target=hexagon-unknown-elf %s 2>&1 \
537 // RUN: | FileCheck --check-prefix=CHECK373 %s
538 // CHECK373-NOT: "+cabac"
539
540 // -----------------------------------------------------------------------------
541 // Misc Defaults
542 // -----------------------------------------------------------------------------
543 // RUN: %clang -### --target=hexagon-unknown-elf \
544 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
545 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK380 %s
546 // CHECK380: "-cc1"
547 // CHECK380-SAME: "-Wreturn-type"
548
549 // -----------------------------------------------------------------------------
550 // Default, hexagon-link is used
551 // -----------------------------------------------------------------------------
552 // RUN: not %clang -### --target=hexagon-unknown-elf \
553 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
554 // RUN: -mcpu=hexagonv60 \
555 // RUN: -fuse-ld=fake-value-to-ignore-CLANG_DEFAULT_LINKER %s 2>&1 | FileCheck -check-prefix=CHECK381 %s
556 // CHECK381: "-march=hexagon"
557 // CHECK381: "-mcpu=hexagonv60"
558 // -----------------------------------------------------------------------------
559 // Passing -fuse-ld=lld
560 // -----------------------------------------------------------------------------
561 // RUN: %clang -### --target=hexagon-unknown-elf \
562 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
563 // RUN: -mcpu=hexagonv60 \
564 // RUN: -fuse-ld=lld %s 2>&1 | FileCheck -check-prefix=CHECK382 %s
565 // CHECK382: "--eh-frame-hdr
566 // CHECK382-NOT: "-march=
567 // CHECK382-NOT: "-mcpu=
568 // -----------------------------------------------------------------------------
569 // Passing --sysroot
570 // -----------------------------------------------------------------------------
571 // RUN: %clang -### --target=hexagon-unknown-elf \
572 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
573 // RUN: -mcpu=hexagonv60 \
574 // RUN: --sysroot=/hexagon %s 2>&1 | FileCheck -check-prefix=CHECK383 %s
575 // CHECK383: "-isysroot" "/hexagon"
576 // CHECK383: "-internal-externc-isystem" "/hexagon{{/|\\\\}}include"
577 // -----------------------------------------------------------------------------
578 // Passing -fno-use-init-array
579 // -----------------------------------------------------------------------------
580 // RUN: %clang -### --target=hexagon-unknown-elf \
581 // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
582 // RUN: -mcpu=hexagonv60 %s 2>&1 | FileCheck -check-prefix=CHECK384 %s
583 // CHECK384: "-fno-use-init-array"