[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / baremetal.cpp
blobf09d7361e6c1385410eb458e1345da23005793b1
1 // UNSUPPORTED: system-windows
3 // RUN: %clang -### %s --target=armv6-none-eabi --emit-static-lib 2>&1 \
4 // RUN: | FileCheck -check-prefixes=CHECK-STATIC-LIB %s
5 // CHECK-STATIC-LIB: {{.*}}llvm-ar{{.*}}" "rcsD"
7 // RUN: %clang %s -### --target=armv6m-none-eabi -o %t.out 2>&1 \
8 // RUN: -T semihosted.lds \
9 // RUN: -L some/directory/user/asked/for \
10 // RUN: --sysroot=%S/Inputs/baremetal_arm \
11 // RUN: | FileCheck --check-prefix=CHECK-V6M-C %s
12 // CHECK-V6M-C: "-cc1" "-triple" "thumbv6m-unknown-none-eabi"
13 // CHECK-V6M-C-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
14 // CHECK-V6M-C-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
15 // CHECK-V6M-C-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
16 // CHECK-V6M-C-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include"
17 // CHECK-V6M-C-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
18 // CHECK-V6M-C-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
19 // CHECK-V6M-C-SAME: "[[SYSROOT:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}crt0.o"
20 // CHECK-V6M-C-SAME: "-T" "semihosted.lds" "-Lsome{{[/\\]+}}directory{{[/\\]+}}user{{[/\\]+}}asked{{[/\\]+}}for"
21 // CHECK-V6M-C-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib"
22 // CHECK-V6M-C-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "--target2=rel" "-o" "{{.*}}.tmp.out"
24 // RUN: %clang %s -### --target=armv6m-none-eabi -nostdlibinc -nobuiltininc 2>&1 \
25 // RUN: --sysroot=%S/Inputs/baremetal_arm | FileCheck --check-prefix=CHECK-V6M-LIBINC %s
26 // RUN: %clang %s -### --target=armv6m-none-eabi -nostdinc 2>&1 \
27 // RUN: --sysroot=%S/Inputs/baremetal_arm | FileCheck --check-prefix=CHECK-V6M-LIBINC %s
28 // CHECK-V6M-LIBINC-NOT: "-internal-isystem"
30 // RUN: %clang %s -### --target=armv6m-none-eabi -o %t.out 2>&1 \
31 // RUN: -ccc-install-dir %S/Inputs/basic_baremetal_tree/bin \
32 // RUN: | FileCheck --check-prefix=CHECK-V6M-TREE %s
33 // CHECK-V6M-TREE: InstalledDir: [[INSTALLED_DIR:.+]]
34 // CHECK-V6M-TREE: "-cc1" "-triple" "thumbv6m-unknown-none-eabi"
35 // CHECK-V6M-TREE-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
36 // CHECK-V6M-TREE-SAME: "-internal-isystem" "[[INSTALLED_DIR]]{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}armv6m-unknown-none-eabi{{[/\\]+}}c++{{[/\\]+}}v1"
37 // CHECK-V6M-TREE-SAME: {{^}} "-internal-isystem" "[[INSTALLED_DIR]]{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
38 // CHECK-V6M-TREE-SAME: "-internal-isystem" "[[INSTALLED_DIR]]{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}armv6m-unknown-none-eabi"
39 // CHECK-V6M-TREE-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
40 // CHECK-V6M-TREE-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
41 // CHECK-V6M-TREE-SAME: "[[INSTALLED_DIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}armv6m-unknown-none-eabi{{[/\\]+}}crt0.o"
42 // CHECK-V6M-TREE-SAME: "-L[[INSTALLED_DIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}armv6m-unknown-none-eabi"
43 // CHECK-V6M-TREE-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "--target2=rel" "-o" "{{.*}}.tmp.out"
45 // RUN: %clang %s -### --target=armv7m-vendor-none-eabi -rtlib=compiler-rt 2>&1 \
46 // RUN: --sysroot=%S/Inputs/baremetal_arm \
47 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
48 // RUN: | FileCheck --check-prefix=CHECK-ARMV7M-PER-TARGET %s
49 // CHECK-ARMV7M-PER-TARGET: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
50 // CHECK-ARMV7M-PER-TARGET: "-isysroot" "[[SYSROOT:[^"]*]]"
51 // CHECK-ARMV7M-PER-TARGET: "-x" "c++" "{{.*}}baremetal.cpp"
52 // CHECK-ARMV7M-PER-TARGET: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
53 // CHECK-ARMV7M-PER_TARGET: "[[SYSROOT:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}crt0.o"
54 // CHECK-ARMV7M-PER-TARGET: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib"
55 // CHECK-ARMV7M-PER-TARGET: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}armv7m-vendor-none-eabi
56 // CHECK-ARMV7M-PER-TARGET: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a"
58 // RUN: %clangxx %s -### --target=armv6m-none-eabi 2>&1 \
59 // RUN: --sysroot=%S/Inputs/baremetal_arm | FileCheck --check-prefix=CHECK-V6M-DEFAULTCXX %s
60 // CHECK-V6M-DEFAULTCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
61 // CHECK-V6M-DEFAULTCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
62 // CHECK-V6M-DEFAULTCXX-SAME: "[[SYSROOT:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}crt0.o"
63 // CHECK-V6M-DEFAULTCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib"
64 // CHECK-V6M-DEFAULTCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
65 // CHECK-V6M-DEFAULTCXX-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "--target2=rel" "-o" "a.out"
67 // RUN: %clangxx %s -### --target=armv6m-none-eabi -stdlib=libc++ 2>&1 \
68 // RUN: --sysroot=%S/Inputs/baremetal_arm | FileCheck --check-prefix=CHECK-V6M-LIBCXX %s
69 // CHECK-V6M-LIBCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
70 // CHECK-V6M-LIBCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}{{[^v].*}}"
71 // CHECK-V6M-LIBCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
72 // CHECK-V6M-LIBCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
73 // CHECK-V6M-LIBCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib"
74 // CHECK-V6M-LIBCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
75 // CHECK-V6M-LIBCXX-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "--target2=rel" "-o" "a.out"
77 // RUN: %clangxx %s -### --target=armv6m-none-eabi 2>&1 \
78 // RUN: --sysroot=%S/Inputs/baremetal_arm \
79 // RUN: -stdlib=libstdc++ \
80 // RUN: | FileCheck --check-prefix=CHECK-V6M-LIBSTDCXX %s
81 // CHECK-V6M-LIBSTDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
82 // CHECK-V6M-LIBSTDCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
83 // CHECK-V6M-LIBSTDCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}6.0.0"
84 // CHECK-V6M-LIBSTDCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
85 // CHECK-V6M-LIBSTDCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib"
86 // CHECK-V6M-LIBSTDCXX-SAME: "-lstdc++" "-lsupc++" "-lunwind"
87 // CHECK-V6M-LIBSTDCXX-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "--target2=rel" "-o" "a.out"
89 // RUN: %clangxx %s -### --target=armv6m-none-eabi 2>&1 \
90 // RUN: --sysroot=%S/Inputs/baremetal_arm \
91 // RUN: -nodefaultlibs \
92 // RUN: | FileCheck --check-prefix=CHECK-V6M-NDL %s
93 // CHECK-V6M-NDL: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
94 // CHECK-V6M-NDL: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
95 // CHECK-V6M-NDL-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib"
97 // RUN: rm -rf %T/baremetal_cxx_sysroot
98 // RUN: mkdir -p %T/baremetal_cxx_sysroot/usr/include/c++/v1
99 // RUN: %clangxx %s -### 2>&1 \
100 // RUN: --target=armv6m-none-eabi \
101 // RUN: --sysroot=%T/baremetal_cxx_sysroot \
102 // RUN: -stdlib=libc++ \
103 // RUN: | FileCheck --check-prefix=CHECK-V6M-LIBCXX-USR %s
104 // CHECK-V6M-LIBCXX-USR: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
105 // CHECK-V6M-LIBCXX-USR-NOT: "-internal-isystem" "{{[^"]+}}baremetal_cxx_sysroot{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}{{[^v].*}}"
106 // CHECK-V6M-LIBCXX-USR-SAME: "-internal-isystem" "{{[^"]+}}baremetal_cxx_sysroot{{[/\\]+}}usr{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
107 // CHECK-V6M-LIBCXX-USR: "{{[^"]*}}-Bstatic"
108 // CHECK-V6M-LIBCXX-USR-SAME: "-L{{[^"]*}}{{[/\\]+}}baremetal_cxx_sysroot{{[/\\]+}}lib"
109 // CHECK-V6M-LIBCXX-USR-SAME: "-lc++" "-lc++abi" "-lunwind"
110 // CHECK-V6M-LIBCXX-USR-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a"
112 // RUN: %clangxx --target=arm-none-eabi -v 2>&1 \
113 // RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL
114 // CHECK-THREAD-MODEL: Thread model: posix
116 // RUN: %clangxx --target=arm-none-eabi -mthread-model single -v 2>&1 \
117 // RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL-SINGLE
118 // CHECK-THREAD-MODEL-SINGLE: Thread model: single
120 // RUN: %clangxx --target=arm-none-eabi -mthread-model posix -v 2>&1 \
121 // RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL-POSIX
122 // CHECK-THREAD-MODEL-POSIX: Thread model: posix
124 // RUN: %clangxx -### --target=arm-none-eabi -nostartfiles -v %s 2>&1 \
125 // RUN: | FileCheck %s --check-prefix=CHECK-NOSTARTFILES
126 // CHECK-NOSTARTFILES-NOT: "crt0.o"
128 // RUN: %clang -### --target=arm-none-eabi -rtlib=libgcc -v %s 2>&1 \
129 // RUN: | FileCheck %s --check-prefix=CHECK-RTLIB-GCC
130 // CHECK-RTLIB-GCC: -lgcc
132 // RUN: %clang -### --target=arm-none-eabi -v %s 2>&1 \
133 // RUN: | FileCheck %s --check-prefix=CHECK-SYSROOT-INC
134 // CHECK-SYSROOT-INC-NOT: "-internal-isystem" "include"
136 // RUN: %clang -### %s --target=armebv7-none-eabi --sysroot=%S/Inputs/baremetal_arm 2>&1 \
137 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s
138 // CHECK-ARMV7EB: "{{.*}}ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "--be8" "-EB"
140 // RUN: %clang -### %s --target=armv7-none-eabi -mbig-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
141 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s
143 // RUN: %clang -### %s --target=armebv7-none-eabi -mbig-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
144 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s
146 // RUN: %clang -### %s --target=armv7-none-eabi --sysroot=%S/Inputs/baremetal_arm 2>&1 \
147 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s
148 // CHECK-ARMV7EL: "{{.*}}ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
149 // CHECK-ARMV7EL-NOT: "--be8"
151 // RUN: %clang -### %s --target=armebv7-none-eabi -mlittle-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
152 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s
154 // RUN: %clang -### %s --target=armv7-none-eabi -mlittle-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
155 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s
157 // RUN: %clang -### %s --target=aarch64_be-none-elf --sysroot=%S/Inputs/baremetal_arm 2>&1 \
158 // RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s
159 // CHECK-AARCH64BE: "{{.*}}ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EB"
160 // CHECK-AARCH64BE-NOT: "--be8"
162 // RUN: %clang -### %s --target=aarch64-none-elf -mbig-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
163 // RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s
165 // RUN: %clang -### %s --target=aarch64_be-none-elf -mbig-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
166 // RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s
168 // RUN: %clang -### %s --target=aarch64-none-elf --sysroot=%S/Inputs/baremetal_arm 2>&1 \
169 // RUN: | FileCheck --check-prefix=CHECK-AARCH64LE %s
170 // CHECK-AARCH64LE: "{{.*}}ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
171 // CHECK-AARCH64LE-NOT: "--be8"
173 // RUN: %clang -### %s --target=aarch64_be-none-elf -mlittle-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
174 // RUN: | FileCheck --check-prefix=CHECK-AARCH64LE %s
176 // RUN: %clang -no-canonical-prefixes %s -### --target=aarch64-none-elf 2>&1 \
177 // RUN: | FileCheck --check-prefix=CHECK-AARCH64-NO-HOST-INC %s
178 // Verify that the bare metal driver does not include any host system paths:
179 // CHECK-AARCH64-NO-HOST-INC: InstalledDir: [[INSTALLEDDIR:.+]]
180 // CHECK-AARCH64-NO-HOST-INC: "-resource-dir" "[[RESOURCE:[^"]+]]"
181 // CHECK-AARCH64-NO-HOST-INC-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include{{[/\\]+}}c++{{[/\\]+}}v1"
182 // CHECK-AARCH64-NO-HOST-INC-SAME: "-internal-isystem" "[[RESOURCE]]{{[/\\]+}}include"
183 // CHECK-AARCH64-NO-HOST-INC-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include"
185 // RUN: %clang %s -### --target=riscv64-unknown-elf -o %t.out -L some/directory/user/asked/for \
186 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf 2>&1 \
187 // RUN: | FileCheck --check-prefix=CHECK-RV64 %s
188 // CHECK-RV64: "-cc1" "-triple" "riscv64-unknown-unknown-elf"
189 // CHECK-RV64-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
190 // CHECK-RV64-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
191 // CHECK-RV64-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
192 // CHECk-RV64-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include"
193 // CHECK-RV64-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
194 // CHECK-RV64-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
195 // CHECK-RV64-SAME: "-Lsome{{[/\\]+}}directory{{[/\\]+}}user{{[/\\]+}}asked{{[/\\]+}}for"
196 // CHECK-RV64-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib"
197 // CHECK-RV64-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-X" "-o" "{{.*}}.tmp.out"
199 // RUN: %clangxx %s -### --target=riscv64-unknown-elf 2>&1 \
200 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
201 // RUN: | FileCheck --check-prefix=CHECK-RV64-DEFAULTCXX %s
202 // CHECK-RV64-DEFAULTCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
203 // CHECK-RV64-DEFAULTCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
204 // CHECK-RV64-DEFAULTCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib"
205 // CHECK-RV64-DEFAULTCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
206 // CHECK-RV64-DEFAULTCXX-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-X" "-o" "a.out"
208 // RUN: %clangxx %s -### --target=riscv64-unknown-elf 2>&1 \
209 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
210 // RUN: -stdlib=libc++ \
211 // RUN: | FileCheck --check-prefix=CHECK-RV64-LIBCXX %s
212 // CHECK-RV64-LIBCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
213 // CHECK-RV64-LIBCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}{{[^v].*}}"
214 // CHECK-RV64-LIBCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
215 // CHECK-RV64-LIBCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
216 // CHECK-RV64-LIBCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib"
217 // CHECK-RV64-LIBCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
218 // CHECK-RV64-LIBCXX-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-X" "-o" "a.out"
220 // RUN: %clangxx %s -### 2>&1 --target=riscv64-unknown-elf \
221 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
222 // RUN: -stdlib=libstdc++ \
223 // RUN: | FileCheck --check-prefix=CHECK-RV64-LIBSTDCXX %s
224 // CHECK-RV64-LIBSTDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
225 // CHECK-RV64-LIBSTDCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
226 // CHECK-RV64-LIBSTDCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}8.0.1"
227 // CHECK-RV64-LIBSTDCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
228 // CHECK-RV64-LIBSTDCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib"
229 // CHECK-RV64-LIBSTDCXX-SAME: "-lstdc++" "-lsupc++" "-lunwind"
230 // CHECK-RV64-LIBSTDCXX-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-X" "-o" "a.out"
232 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
233 // RUN: -L some/directory/user/asked/for \
234 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
235 // RUN: | FileCheck --check-prefix=CHECK-RV32 %s
236 // CHECK-RV32: "-cc1" "-triple" "riscv32-unknown-unknown-elf"
237 // CHECK-RV32-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
238 // CHECK-RV32-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
239 // CHECK-RV32-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
240 // CHECK-RV32-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include"
241 // CHECK-RV32-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
242 // CHECK-RV32-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
243 // CHECK-RV32-SAME: "-Lsome{{[/\\]+}}directory{{[/\\]+}}user{{[/\\]+}}asked{{[/\\]+}}for"
244 // CHECK-RV32-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib"
245 // CHECK-RV32-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-X" "-o" "a.out"
247 // RUN: %clangxx %s -### 2>&1 --target=riscv32-unknown-elf \
248 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
249 // RUN: | FileCheck --check-prefix=CHECK-RV32-DEFAULTCXX %s
250 // CHECK-RV32-DEFAULTCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
251 // CHECK-RV32-DEFAULTCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
252 // CHECK-RV32-DEFAULTCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv32_tree{{[/\\]+}}riscv32-unknown-elf{{[/\\]+}}lib"
253 // CHECK-RV32-DEFAULTCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
254 // CHECK-RV32-DEFAULTCXX-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-X" "-o" "a.out"
256 // RUN: %clangxx %s -### 2>&1 --target=riscv32-unknown-elf \
257 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
258 // RUN: -stdlib=libc++ \
259 // RUN: | FileCheck --check-prefix=CHECK-RV32-LIBCXX %s
260 // CHECK-RV32-LIBCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
261 // CHECK-RV32-LIBCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}{{[^v].*}}"
262 // CHECK-RV32-LIBCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
263 // CHECK-RV32-LIBCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
264 // CHECK-RV32-LIBCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv32_tree{{[/\\]+}}riscv32-unknown-elf{{[/\\]+}}lib"
265 // CHECK-RV32-LIBCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
266 // CHECK-RV32-LIBCXX-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-X" "-o" "a.out"
268 // RUN: %clangxx %s -### 2>&1 --target=riscv32-unknown-elf \
269 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
270 // RUN: -stdlib=libstdc++ \
271 // RUN: | FileCheck --check-prefix=CHECK-RV32-LIBSTDCXX %s
272 // CHECK-RV32-LIBSTDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
273 // CHECK-RV32-LIBSTDCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
274 // CHECK-RV32-LIBSTDCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}8.0.1"
275 // CHECK-RV32-LIBSTDCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
276 // CHECK-RV32-LIBSTDCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv32_tree{{[/\\]+}}riscv32-unknown-elf{{[/\\]+}}lib"
277 // CHECK-RV32-LIBSTDCXX-SAME: "-lstdc++" "-lsupc++" "-lunwind"
278 // CHECK-RV32-LIBSTDCXX-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-X" "-o" "a.out"
280 // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf \
281 // RUN: -nostdlibinc -nobuiltininc \
282 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
283 // RUN: | FileCheck --check-prefix=CHECK-RV64-LIBINC %s
285 // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf -nostdinc \
286 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
287 // RUN: | FileCheck --check-prefix=CHECK-RV64-LIBINC %s
288 // CHECK-RV64-LIBINC-NOT: "-internal-isystem"
290 // RUN: %clangxx %s -### 2>&1 --target=riscv64-unknown-elf \
291 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
292 // RUN: -nodefaultlibs \
293 // RUN: | FileCheck --check-prefix=CHECK-RV64-NDL %s
294 // CHECK-RV64-NDL: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
295 // CHECK-RV64-NDL: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
296 // CHECK-RV64-NDL-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib"
298 // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf \
299 // RUN: -march=rv64imafdc -mabi=lp64d \
300 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
301 // RUN: | FileCheck --check-prefix=CHECK-RV64FD %s
303 // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf \
304 // RUN: -march=rv64gc -mabi=lp64d \
305 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
306 // RUN: | FileCheck --check-prefix=CHECK-RV64FD %s
308 // CHECK-RV64FD: "-cc1" "-triple" "riscv64-unknown-unknown-elf"
309 // CHECK-RV64FD-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
310 // CHECK-RV64FD-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
311 // CHECK-RV64FD-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv64imafdc{{[/\\]+}}lp64d{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
312 // CHECk-RV64FD-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv64imafdc{{[/\\]+}}lp64d{{[/\\]+}}include"
313 // CHECK-RV64FD-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
314 // CHECK-RV64FD-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
315 // CHECK-RV64FD-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv64imafdc{{[/\\]+}}lp64d{{[/\\]+}}lib"
317 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
318 // RUN: -march=rv32i -mabi=ilp32 \
319 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
320 // RUN: | FileCheck --check-prefix=CHECK-RV32I %s
322 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
323 // RUN: -march=rv32ic -mabi=ilp32 \
324 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
325 // RUN: | FileCheck --check-prefix=CHECK-RV32I %s
327 // CHECK-RV32I: "-cc1" "-triple" "riscv32-unknown-unknown-elf"
328 // CHECK-RV32I-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
329 // CHECK-RV32I-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
330 // CHECK-RV32I-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32i{{[/\\]+}}ilp32{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
331 // CHECK-RV32I-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32i{{[/\\]+}}ilp32{{[/\\]+}}include"
332 // CHECK-RV32I-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
333 // CHECK-RV32I-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
334 // CHECK-RV32I-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv32i{{[/\\]+}}ilp32{{[/\\]+}}lib"
336 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
337 // RUN: -march=rv32im -mabi=ilp32 \
338 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
339 // RUN: | FileCheck --check-prefix=CHECK-RV32IM %s
341 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
342 // RUN: -march=rv32imc -mabi=ilp32 \
343 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
344 // RUN: | FileCheck --check-prefix=CHECK-RV32IM %s
346 // CHECK-RV32IM: "-cc1" "-triple" "riscv32-unknown-unknown-elf"
347 // CHECK-RV32IM-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
348 // CHECK-RV32IM-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
349 // CHECK-RV32IM-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32im{{[/\\]+}}ilp32{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
350 // CHECK-RV32IM-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32im{{[/\\]+}}ilp32{{[/\\]+}}include"
351 // CHECK-RV32IM-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
352 // CHECK-RV32IM-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
353 // CHECK-RV32IM-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv32im{{[/\\]+}}ilp32{{[/\\]+}}lib"
355 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
356 // RUN: -march=rv32iac -mabi=ilp32 \
357 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
358 // RUN: | FileCheck --check-prefix=CHECK-RV32IAC %s
360 // CHECK-RV32IAC: "-cc1" "-triple" "riscv32-unknown-unknown-elf"
361 // CHECK-RV32IAC-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
362 // CHECK-RV32IAC-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
363 // CHECK-RV32IAC-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32iac{{[/\\]+}}ilp32{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
364 // CHECK-RV32IAC-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32iac{{[/\\]+}}ilp32{{[/\\]+}}include"
365 // CHECK-RV32IAC-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
366 // CHECK-RV32IAC-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
367 // CHECK-RV32IAC-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv32iac{{[/\\]+}}ilp32{{[/\\]+}}lib"
369 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf -march=rv32imafc -mabi=ilp32f \
370 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
371 // RUN: | FileCheck --check-prefix=CHECK-RV32IMAFC %s
373 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf -march=rv32imafdc -mabi=ilp32f \
374 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
375 // RUN: | FileCheck --check-prefix=CHECK-RV32IMAFC %s
377 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf -march=rv32gc -mabi=ilp32f \
378 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
379 // RUN: | FileCheck --check-prefix=CHECK-RV32IMAFC %s
381 // CHECK-RV32IMAFC: "-cc1" "-triple" "riscv32-unknown-unknown-elf"
382 // CHECK-RV32IMAFC-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
383 // CHECK-RV32IMAFC-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
384 // CHECK-RV32IMAFC-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32imafc{{[/\\]+}}ilp32f{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
385 // CHECK-RV32IMAFC-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32imafc{{[/\\]+}}ilp32f{{[/\\]+}}include"
386 // CHECK-RV32IMAFC-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
387 // CHECK-RV32IMAFC-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
388 // CHECK-RV32IMAFC-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv32imafc{{[/\\]+}}ilp32f{{[/\\]+}}lib"
390 // RUN: %clang -no-canonical-prefixes %s -### --target=powerpc-unknown-eabi 2>&1 \
391 // RUN: | FileCheck --check-prefix=CHECK-PPCEABI %s
392 // CHECK-PPCEABI: InstalledDir: [[INSTALLEDDIR:.+]]
393 // CHECK-PPCEABI: "-nostdsysteminc"
394 // CHECK-PPCEABI-SAME: "-resource-dir" "[[RESOURCE:[^"]+]]"
395 // CHECK-PPCEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include{{[/\\]+}}c++{{[/\\]+}}v1"
396 // CHECK-PPCEABI-SAME: "-internal-isystem" "[[RESOURCE]]{{[/\\]+}}include"
397 // CHECK-PPCEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include"
398 // CHECK-PPCEABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
399 // CHECK-PPCEABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib"
400 // CHECK-PPCEABI-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-o" "a.out"
402 // RUN: %clang -no-canonical-prefixes %s -### --target=powerpc64-unknown-eabi 2>&1 \
403 // RUN: | FileCheck --check-prefix=CHECK-PPC64EABI %s
404 // CHECK-PPC64EABI: InstalledDir: [[INSTALLEDDIR:.+]]
405 // CHECK-PPC64EABI: "-nostdsysteminc"
406 // CHECK-PPC64EABI-SAME: "-resource-dir" "[[RESOURCE:[^"]+]]"
407 // CHECK-PPC64EABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include{{[/\\]+}}c++{{[/\\]+}}v1"
408 // CHECK-PPC64EABI-SAME: "-internal-isystem" "[[RESOURCE]]{{[/\\]+}}include"
409 // CHECK-PPC64EABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include"
410 // CHECK-PPC64EABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
411 // CHECK-PPC64EABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib"
412 // CHECK-PPC64EABI-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-o" "a.out"
414 // RUN: %clang -no-canonical-prefixes %s -### --target=powerpcle-unknown-eabi 2>&1 \
415 // RUN: | FileCheck --check-prefix=CHECK-PPCLEEABI %s
416 // CHECK-PPCLEEABI: InstalledDir: [[INSTALLEDDIR:.+]]
417 // CHECK-PPCLEEABI: "-nostdsysteminc"
418 // CHECK-PPCLEEABI-SAME: "-resource-dir" "[[RESOURCE:[^"]+]]"
419 // CHECK-PPCLEEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include{{[/\\]+}}c++{{[/\\]+}}v1"
420 // CHECK-PPCLEEABI-SAME: "-internal-isystem" "[[RESOURCE]]{{[/\\]+}}include"
421 // CHECK-PPCLEEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include"
422 // CHECK-PPCLEEABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
423 // CHECK-PPCLEEABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib"
424 // CHECK-PPCLEEABI-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-o" "a.out"
426 // RUN: %clang -no-canonical-prefixes %s -### --target=powerpc64le-unknown-eabi 2>&1 \
427 // RUN: | FileCheck --check-prefix=CHECK-PPC64LEEABI %s
428 // CHECK-PPC64LEEABI: InstalledDir: [[INSTALLEDDIR:.+]]
429 // CHECK-PPC64LEEABI: "-nostdsysteminc"
430 // CHECK-PPC64LEEABI-SAME: "-resource-dir" "[[RESOURCE:[^"]+]]"
431 // CHECK-PPC64LEEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include{{[/\\]+}}c++{{[/\\]+}}v1"
432 // CHECK-PPC64LEEABI-SAME: "-internal-isystem" "[[RESOURCE]]{{[/\\]+}}include"
433 // CHECK-PPC64LEEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include"
434 // CHECK-PPC64LEEABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
435 // CHECK-PPC64LEEABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib"
436 // CHECK-PPC64LEEABI-SAME: "-lc" "-lm" "{{[^"]*}}libclang_rt.builtins.a" "-o" "a.out"
438 // Check that compiler-rt library without the arch filename suffix will
439 // be used if present.
440 // RUN: rm -rf %T/baremetal_clang_rt_noarch
441 // RUN: mkdir -p %T/baremetal_clang_rt_noarch/lib
442 // RUN: touch %T/baremetal_clang_rt_noarch/lib/libclang_rt.builtins.a
443 // RUN: %clang %s -### 2>&1 \
444 // RUN: --target=armv6m-none-eabi \
445 // RUN: --sysroot=%T/baremetal_clang_rt_noarch \
446 // RUN: | FileCheck --check-prefix=CHECK-CLANGRT-NOARCH %s
447 // CHECK-CLANGRT-NOARCH: "{{[^"]*}}libclang_rt.builtins.a"
448 // CHECK-CLANGRT-NOARCH-NOT: "{{[^"]*}}libclang_rt.builtins.a"
450 // Check that compiler-rt library with the arch filename suffix will be
451 // used if present.
452 // RUN: rm -rf %T/baremetal_clang_rt_arch
453 // RUN: mkdir -p %T/baremetal_clang_rt_arch/lib
454 // RUN: touch %T/baremetal_clang_rt_arch/lib/libclang_rt.builtins-armv6m.a
455 // RUN: %clang %s -### 2>&1 \
456 // RUN: --target=armv6m-none-eabi \
457 // RUN: --sysroot=%T/baremetal_clang_rt_arch \
458 // RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARCH %s
459 // CHECK-CLANGRT-ARCH: "{{[^"]*}}libclang_rt.builtins.a"
460 // CHECK-CLANGRT-ARCH-NOT: "{{[^"]*}}libclang_rt.builtins.a"
462 // Check that "--no-relax" is forwarded to the linker for RISC-V.
463 // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf -nostdinc -mno-relax \
464 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
465 // RUN: | FileCheck --check-prefix=CHECK-RV64-NORELAX %s
466 // CHECK-RV64-NORELAX: "--no-relax"
468 // Check that "--no-relax" is not forwarded to the linker for RISC-V.
469 // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf -nostdinc \
470 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
471 // RUN: | FileCheck --check-prefix=CHECK-RV64-RELAX %s
472 // CHECK-RV64-RELAX-NOT: "--no-relax"