[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / fuchsia.c
blob83dee16981690a3b6699689d6556bdcaf76b267b
1 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
2 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
3 // RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
4 // RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s
5 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
6 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
7 // RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
8 // RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
9 // RUN: %clang -### %s --target=riscv64-unknown-fuchsia \
10 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
11 // RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
12 // RUN: | FileCheck -check-prefixes=CHECK,CHECK-RISCV64 %s
13 // RUN: %clang -### %s --target=x86_64-fuchsia \
14 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
15 // RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
16 // RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s
17 // RUN: %clang -### %s --target=aarch64-fuchsia \
18 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
19 // RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
20 // RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
21 // RUN: %clang -### %s --target=riscv64-fuchsia \
22 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
23 // RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
24 // RUN: | FileCheck -check-prefixes=CHECK,CHECK-RISCV64 %s
25 // CHECK: "-cc1"
26 // CHECK-X86_64: "-triple" "x86_64-unknown-fuchsia"
27 // CHECK-AARCH64: "-triple" "aarch64-unknown-fuchsia"
28 // CHECK-RISCV64: "-triple" "riscv64-unknown-fuchsia"
29 // CHECK: "-funwind-tables=2"
30 // CHECK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
31 // CHECK: "-isysroot" "[[SYSROOT:[^"]+]]"
32 // CHECK: "-internal-externc-isystem" "[[SYSROOT]]{{/|\\\\}}include"
33 // CHECK: "-stack-protector" "2"
34 // CHECK-AARCH64: "-fsanitize=shadow-call-stack"
35 // CHECK-RISCV64: "-fsanitize=shadow-call-stack"
36 // CHECK-X86_64: "-fsanitize=safe-stack"
37 // CHECK-AARCH64: "-target-feature" "+outline-atomics"
38 // CHECK-NOT: "-fcommon"
39 // CHECK: {{.*}}ld.lld{{.*}}" "-z" "max-page-size=4096" "-z" "now" "-z" "start-stop-visibility=hidden" "-z" "rodynamic" "-z" "separate-loadable-segments" "-z" "rel" "--pack-dyn-relocs=relr"
40 // CHECK: "--sysroot=[[SYSROOT]]"
41 // CHECK: "-pie"
42 // CHECK: "--build-id"
43 // CHECK: "--hash-style=gnu"
44 // CHECK-AARCH64: "--execute-only" "--fix-cortex-a53-843419"
45 // CHECK: "-dynamic-linker" "ld.so.1"
46 // CHECK-RISCV64: "-X"
47 // CHECK: Scrt1.o
48 // CHECK-NOT: crti.o
49 // CHECK-NOT: crtbegin.o
50 // CHECK: "-L[[SYSROOT]]{{/|\\\\}}lib"
51 // CHECK-X86_64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
52 // CHECK-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-unknown-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
53 // CHECK-RISCV64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}riscv64-unknown-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
54 // CHECK: "-lc"
55 // CHECK-NOT: crtend.o
56 // CHECK-NOT: crtn.o
58 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
59 // RUN: --emit-static-lib 2>&1 | FileCheck -check-prefixes=CHECK-STATIC-LIB %s
60 // CHECK-STATIC-LIB: {{.*}}llvm-ar{{.*}}" "rcsD"
62 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia 2>&1 \
63 // RUN: | FileCheck %s -check-prefix=CHECK-FP-ALL
64 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia 2>&1 \
65 // RUN: | FileCheck %s -check-prefix=CHECK-FP-NONLEAF
66 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia -O3 2>&1 \
67 // RUN: | FileCheck %s -check-prefix=CHECK-FP-NONE
68 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia -O3 2>&1 \
69 // RUN: | FileCheck %s -check-prefix=CHECK-FP-NONE
70 // CHECK-FP-ALL: "-mframe-pointer=all"
71 // CHECK-FP-NONLEAF: "-mframe-pointer=non-leaf"
72 // CHECK-FP-NONE: "-mframe-pointer=none"
74 // RUN: not %clang -### %s --target=x86_64-unknown-fuchsia -rtlib=libgcc 2>&1 \
75 // RUN: | FileCheck %s -check-prefix=CHECK-RTLIB
76 // CHECK-RTLIB: error: invalid runtime library name in argument '-rtlib=libgcc'
78 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia -static -fuse-ld=ld 2>&1 \
79 // RUN: | FileCheck %s -check-prefix=CHECK-STATIC
80 // CHECK-STATIC: "-Bstatic"
81 // CHECK-STATIC: "-Bdynamic"
82 // CHECK-STATIC: "-lc"
84 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia -shared -fuse-ld=ld 2>&1 \
85 // RUN: | FileCheck %s -check-prefix=CHECK-SHARED
86 // CHECK-SHARED-NOT: "-pie"
87 // CHECK-SHARED: "-shared"
89 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia -r -fuse-ld=ld 2>&1 \
90 // RUN: | FileCheck %s -check-prefix=CHECK-RELOCATABLE
91 // CHECK-RELOCATABLE-NOT: "-pie"
92 // CHECK-RELOCATABLE-NOT: "--build-id"
93 // CHECK-RELOCATABLE-NOT "-dynamic-linker"
94 // CHECK-RELOCATABLE: "-r"
95 // CHECK-RELOCATABLE-NOT: "-l
96 // CHECK-RELOCATABLE-NOT: crt{{[^./\\]+}}.o
98 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nodefaultlibs -fuse-ld=ld 2>&1 \
99 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
100 // RUN: | FileCheck %s -check-prefix=CHECK-NODEFAULTLIBS
101 // CHECK-NODEFAULTLIBS: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
102 // CHECK-NODEFAULTLIBS-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
103 // CHECK-NODEFAULTLIBS-NOT: "-lc"
105 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nostdlib -fuse-ld=ld 2>&1 \
106 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
107 // RUN: | FileCheck %s -check-prefix=CHECK-NOSTDLIB
108 // CHECK-NOSTDLIB: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
109 // CHECK-NOSTDLIB-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
110 // CHECK-NOSTDLIB-NOT: "-lc"
112 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nolibc -fuse-ld=ld 2>&1 \
113 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
114 // RUN: | FileCheck %s -check-prefix=CHECK-NOLIBC
115 // CHECK-NOLIBC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
116 // CHECK-NOLIBC: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
117 // CHECK-NOLIBC-NOT: "-lc"
119 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
120 // RUN: -fsanitize=safe-stack 2>&1 \
121 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
122 // RUN: -fuse-ld=ld \
123 // RUN: | FileCheck %s -check-prefix=CHECK-SAFESTACK
124 // CHECK-SAFESTACK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
125 // CHECK-SAFESTACK: "-fsanitize=safe-stack"
126 // CHECK-SAFESTACK-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.safestack.a"
127 // CHECK-SAFESTACK-NOT: "__safestack_init"
129 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
130 // RUN: -fsanitize=address 2>&1 \
131 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
132 // RUN: -fuse-ld=ld \
133 // RUN: | FileCheck %s -check-prefix=CHECK-ASAN-X86
134 // CHECK-ASAN-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
135 // CHECK-ASAN-X86: "-fsanitize=address"
136 // CHECK-ASAN-X86: "-fsanitize-address-globals-dead-stripping"
137 // CHECK-ASAN-X86: "-dynamic-linker" "asan/ld.so.1"
138 // CHECK-ASAN-X86: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.asan.so"
139 // CHECK-ASAN-X86: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.asan-preinit.a"
141 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
142 // RUN: -fsanitize=address 2>&1 \
143 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
144 // RUN: -fuse-ld=ld \
145 // RUN: | FileCheck %s -check-prefix=CHECK-ASAN-AARCH64
146 // CHECK-ASAN-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
147 // CHECK-ASAN-AARCH64: "-fsanitize=address,shadow-call-stack"
148 // CHECK-ASAN-AARCH64: "-fsanitize-address-globals-dead-stripping"
149 // CHECK-ASAN-AARCH64: "-dynamic-linker" "asan/ld.so.1"
150 // CHECK-ASAN-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-unknown-fuchsia{{/|\\\\}}libclang_rt.asan.so"
151 // CHECK-ASAN-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-unknown-fuchsia{{/|\\\\}}libclang_rt.asan-preinit.a"
153 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
154 // RUN: -fsanitize=address -fPIC -shared 2>&1 \
155 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
156 // RUN: -fuse-ld=ld \
157 // RUN: | FileCheck %s -check-prefix=CHECK-ASAN-SHARED
158 // CHECK-ASAN-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
159 // CHECK-ASAN-SHARED: "-fsanitize=address"
160 // CHECK-ASAN-SHARED: "-fsanitize-address-globals-dead-stripping"
161 // CHECK-ASAN-SHARED: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.asan.so"
162 // CHECK-ASAN-SHARED-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.asan-preinit.a"
164 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
165 // RUN: -fsanitize=fuzzer 2>&1 \
166 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
167 // RUN: -fuse-ld=ld \
168 // RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-X86
169 // CHECK-FUZZER-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
170 // CHECK-FUZZER-X86: "-fsanitize=fuzzer,fuzzer-no-link,safe-stack"
171 // CHECK-FUZZER-X86: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.fuzzer.a"
173 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
174 // RUN: -fsanitize=fuzzer 2>&1 \
175 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
176 // RUN: -fuse-ld=ld \
177 // RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-AARCH64
178 // CHECK-FUZZER-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
179 // CHECK-FUZZER-AARCH64: "-fsanitize=fuzzer,fuzzer-no-link,shadow-call-stack"
180 // CHECK-FUZZER-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-unknown-fuchsia{{/|\\\\}}libclang_rt.fuzzer.a"
182 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
183 // RUN: -fsanitize=scudo 2>&1 \
184 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
185 // RUN: -fuse-ld=ld \
186 // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-X86
187 // CHECK-SCUDO-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
188 // CHECK-SCUDO-X86: "-fsanitize=safe-stack,scudo"
189 // CHECK-SCUDO-X86: "-pie"
190 // CHECK-SCUDO-X86: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{.*}}fuchsia{{.*}}libclang_rt.scudo_standalone.so"
192 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
193 // RUN: -fsanitize=scudo 2>&1 \
194 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
195 // RUN: -fuse-ld=ld \
196 // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-AARCH64
197 // CHECK-SCUDO-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
198 // CHECK-SCUDO-AARCH64: "-fsanitize=shadow-call-stack,scudo"
199 // CHECK-SCUDO-AARCH64: "-pie"
200 // CHECK-SCUDO-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{.*}}fuchsia{{.*}}libclang_rt.scudo_standalone.so"
202 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
203 // RUN: -fsanitize=scudo -fPIC -shared 2>&1 \
204 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
205 // RUN: -fuse-ld=ld \
206 // RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-SHARED
207 // CHECK-SCUDO-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
208 // CHECK-SCUDO-SHARED: "-fsanitize=safe-stack,scudo"
209 // CHECK-SCUDO-SHARED: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{.*}}fuchsia{{.*}}libclang_rt.scudo_standalone.so"
211 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
212 // RUN: -fsanitize=leak 2>&1 \
213 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
214 // RUN: -fuse-ld=ld \
215 // RUN: | FileCheck %s -check-prefix=CHECK-LSAN-AARCH64
216 // CHECK-LSAN-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
217 // CHECK-LSAN-AARCH64: "-fsanitize=leak,shadow-call-stack"
218 // CHECK-LSAN-AARCH64: "-pie"
219 // CHECK-LSAN-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-unknown-fuchsia{{/|\\\\}}libclang_rt.lsan.a"
221 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
222 // RUN: -fsanitize=leak 2>&1 \
223 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
224 // RUN: -fuse-ld=ld \
225 // RUN: | FileCheck %s -check-prefix=CHECK-LSAN-X86
226 // CHECK-LSAN-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
227 // CHECK-LSAN-X86: "-fsanitize=leak,safe-stack"
228 // CHECK-LSAN-X86: "-pie"
229 // CHECK-LSAN-X86: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.lsan.a"
231 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
232 // RUN: -fsanitize=leak -fPIC -shared 2>&1 \
233 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
234 // RUN: -fuse-ld=ld \
235 // RUN: | FileCheck %s -check-prefix=CHECK-LSAN-SHARED
236 // CHECK-LSAN-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
237 // CHECK-LSAN-SHARED: "-fsanitize=leak,shadow-call-stack"
238 // CHECK-LSAN-SHARED-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-unknown-fuchsia{{/|\\\\}}libclang_rt.lsan.a"
240 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
241 // RUN: -fxray-instrument -fxray-modes=xray-basic \
242 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
243 // RUN: -fuse-ld=ld 2>&1 \
244 // RUN: | FileCheck %s -check-prefix=CHECK-XRAY-X86
245 // CHECK-XRAY-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
246 // CHECK-XRAY-X86: "-fxray-instrument"
247 // CHECK-XRAY-X86: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.xray.a"
248 // CHECK-XRAY-X86: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.xray-basic.a"
250 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
251 // RUN: -fxray-instrument -fxray-modes=xray-basic \
252 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
253 // RUN: -fuse-ld=ld 2>&1 \
254 // RUN: | FileCheck %s -check-prefix=CHECK-XRAY-AARCH64
255 // CHECK-XRAY-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
256 // CHECK-XRAY-AARCH64: "-fxray-instrument"
257 // CHECK-XRAY-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-unknown-fuchsia{{/|\\\\}}libclang_rt.xray.a"
258 // CHECK-XRAY-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-unknown-fuchsia{{/|\\\\}}libclang_rt.xray-basic.a"
260 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
261 // RUN: -O3 -flto -mcpu=cortex-a53 2>&1 \
262 // RUN: -fuse-ld=ld \
263 // RUN: | FileCheck %s -check-prefix=CHECK-LTO
264 // CHECK-LTO: "-plugin-opt=mcpu=cortex-a53"
265 // CHECK-LTO: "-plugin-opt=O3"
267 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
268 // RUN: -flto=thin -flto-jobs=8 2>&1 \
269 // RUN: -fuse-ld=ld \
270 // RUN: | FileCheck %s -check-prefix=CHECK-THINLTO
271 // CHECK-THINLTO: "-plugin-opt=mcpu=x86-64"
272 // CHECK-THINLTO: "-plugin-opt=thinlto"
273 // CHECK-THINLTO: "-plugin-opt=jobs=8"
275 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
276 // RUN: -gsplit-dwarf -g -c %s 2>&1 \
277 // RUN: | FileCheck %s -check-prefix=CHECK-SPLIT-DWARF
278 // CHECK-SPLIT-DWARF: "-split-dwarf-output" "fuchsia.dwo"
280 // RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
281 // RUN: -fprofile-instr-generate -fcoverage-mapping \
282 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
283 // RUN: -fuse-ld=ld 2>&1 \
284 // RUN: | FileCheck %s -check-prefix=CHECK-PROFRT-AARCH64
285 // CHECK-PROFRT-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
286 // CHECK-PROFRT-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-unknown-fuchsia{{/|\\\\}}libclang_rt.profile.a"
288 // RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
289 // RUN: -fprofile-instr-generate -fcoverage-mapping \
290 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
291 // RUN: -fuse-ld=ld 2>&1 \
292 // RUN: | FileCheck %s -check-prefix=CHECK-PROFRT-X86_64
293 // CHECK-PROFRT-X86_64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
294 // CHECK-PROFRT-X86_64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.profile.a"
296 // Check that the -X and --no-relax flags are passed to the linker on riscv64
297 // RUN: %clang --target=riscv64-unknown-fuchsia -mno-relax -### %s 2>&1 \
298 // RUN: | FileCheck -check-prefix=RISCV64-FLAGS %s
299 // RISCV64-FLAGS: "-X" "--no-relax"