Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Driver / baremetal.cpp
blobc04f4506a0994db30a5dd09a34e75d22283fd66f
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-none-unknown-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: "-T" "semihosted.lds" "-Lsome{{[/\\]+}}directory{{[/\\]+}}user{{[/\\]+}}asked{{[/\\]+}}for"
20 // CHECK-V6M-C-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib"
21 // CHECK-V6M-C-SAME: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
22 // CHECK-V6M-C-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m" "--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=armv7m-vendor-none-eabi -rtlib=compiler-rt 2>&1 \
31 // RUN: --sysroot=%S/Inputs/baremetal_arm \
32 // RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
33 // RUN: | FileCheck --check-prefix=CHECK-ARMV7M-PER-TARGET %s
34 // CHECK-ARMV7M-PER-TARGET: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
35 // CHECK-ARMV7M-PER-TARGET: "-isysroot" "[[SYSROOT:[^"]*]]"
36 // CHECK-ARMV7M-PER-TARGET: "-x" "c++" "{{.*}}baremetal.cpp"
37 // CHECK-ARMV7M-PER-TARGET: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
38 // CHECK-ARMV7M-PER-TARGET: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib"
39 // CHECK-ARMV7M-PER-TARGET: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}armv7m-vendor-none-eabi
40 // CHECK-ARMV7M-PER-TARGET: "-lc" "-lm" "-lclang_rt.builtins"
42 // RUN: %clangxx %s -### --target=armv6m-none-eabi 2>&1 \
43 // RUN: --sysroot=%S/Inputs/baremetal_arm | FileCheck --check-prefix=CHECK-V6M-DEFAULTCXX %s
44 // CHECK-V6M-DEFAULTCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
45 // CHECK-V6M-DEFAULTCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
46 // CHECK-V6M-DEFAULTCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib"
47 // CHECK-V6M-DEFAULTCXX-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
48 // CHECK-V6M-DEFAULTCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
49 // CHECK-V6M-DEFAULTCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m" "--target2=rel" "-o" "a.out"
51 // RUN: %clangxx %s -### --target=armv6m-none-eabi -stdlib=libc++ 2>&1 \
52 // RUN: --sysroot=%S/Inputs/baremetal_arm | FileCheck --check-prefix=CHECK-V6M-LIBCXX %s
53 // CHECK-V6M-LIBCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
54 // CHECK-V6M-LIBCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}{{[^v].*}}"
55 // CHECK-V6M-LIBCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
56 // CHECK-V6M-LIBCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
57 // CHECK-V6M-LIBCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib"
58 // CHECK-V6M-LIBCXX-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
59 // CHECK-V6M-LIBCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
60 // CHECK-V6M-LIBCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m" "--target2=rel" "-o" "a.out"
62 // RUN: %clangxx %s -### --target=armv6m-none-eabi 2>&1 \
63 // RUN: --sysroot=%S/Inputs/baremetal_arm \
64 // RUN: -stdlib=libstdc++ \
65 // RUN: | FileCheck --check-prefix=CHECK-V6M-LIBSTDCXX %s
66 // CHECK-V6M-LIBSTDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
67 // CHECK-V6M-LIBSTDCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
68 // CHECK-V6M-LIBSTDCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}6.0.0"
69 // CHECK-V6M-LIBSTDCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
70 // CHECK-V6M-LIBSTDCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib"
71 // CHECK-V6M-LIBSTDCXX-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
72 // CHECK-V6M-LIBSTDCXX-SAME: "-lstdc++" "-lsupc++" "-lunwind"
73 // CHECK-V6M-LIBSTDCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m" "--target2=rel" "-o" "a.out"
75 // RUN: %clangxx %s -### --target=armv6m-none-eabi 2>&1 \
76 // RUN: --sysroot=%S/Inputs/baremetal_arm \
77 // RUN: -nodefaultlibs \
78 // RUN: | FileCheck --check-prefix=CHECK-V6M-NDL %s
79 // CHECK-V6M-NDL: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
80 // CHECK-V6M-NDL: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
81 // CHECK-V6M-NDL-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}baremetal_arm{{[/\\]+}}lib"
82 // CHECK-V6M-NDL-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
84 // RUN: rm -rf %T/baremetal_cxx_sysroot
85 // RUN: mkdir -p %T/baremetal_cxx_sysroot/usr/include/c++/v1
86 // RUN: %clangxx %s -### 2>&1 \
87 // RUN: --target=armv6m-none-eabi \
88 // RUN: --sysroot=%T/baremetal_cxx_sysroot \
89 // RUN: -stdlib=libc++ \
90 // RUN: | FileCheck --check-prefix=CHECK-V6M-LIBCXX-USR %s
91 // CHECK-V6M-LIBCXX-USR: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
92 // CHECK-V6M-LIBCXX-USR-NOT: "-internal-isystem" "{{[^"]+}}baremetal_cxx_sysroot{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}{{[^v].*}}"
93 // CHECK-V6M-LIBCXX-USR-SAME: "-internal-isystem" "{{[^"]+}}baremetal_cxx_sysroot{{[/\\]+}}usr{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
94 // CHECK-V6M-LIBCXX-USR: "{{[^"]*}}-Bstatic"
95 // CHECK-V6M-LIBCXX-USR-SAME: "-L{{[^"]*}}{{[/\\]+}}baremetal_cxx_sysroot{{[/\\]+}}lib"
96 // CHECK-V6M-LIBCXX-USR-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
97 // CHECK-V6M-LIBCXX-USR-SAME: "-lc++" "-lc++abi" "-lunwind"
98 // CHECK-V6M-LIBCXX-USR-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m"
100 // RUN: %clangxx --target=arm-none-eabi -v 2>&1 \
101 // RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL
102 // CHECK-THREAD-MODEL: Thread model: posix
104 // RUN: %clangxx --target=arm-none-eabi -mthread-model single -v 2>&1 \
105 // RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL-SINGLE
106 // CHECK-THREAD-MODEL-SINGLE: Thread model: single
108 // RUN: %clangxx --target=arm-none-eabi -mthread-model posix -v 2>&1 \
109 // RUN: | FileCheck %s --check-prefix=CHECK-THREAD-MODEL-POSIX
110 // CHECK-THREAD-MODEL-POSIX: Thread model: posix
112 // RUN: %clang -### --target=arm-none-eabi -rtlib=libgcc -v %s 2>&1 \
113 // RUN: | FileCheck %s --check-prefix=CHECK-RTLIB-GCC
114 // CHECK-RTLIB-GCC: -lgcc
116 // RUN: %clang -### --target=arm-none-eabi -v %s 2>&1 \
117 // RUN: | FileCheck %s --check-prefix=CHECK-SYSROOT-INC
118 // CHECK-SYSROOT-INC-NOT: "-internal-isystem" "include"
120 // RUN: %clang -### %s --target=armebv7-none-eabi --sysroot=%S/Inputs/baremetal_arm 2>&1 \
121 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s
122 // CHECK-ARMV7EB: "{{.*}}ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "--be8" "-EB"
124 // RUN: %clang -### %s --target=armv7-none-eabi -mbig-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
125 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s
127 // RUN: %clang -### %s --target=armebv7-none-eabi -mbig-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
128 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EB %s
130 // RUN: %clang -### %s --target=armv7-none-eabi --sysroot=%S/Inputs/baremetal_arm 2>&1 \
131 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s
132 // CHECK-ARMV7EL: "{{.*}}ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
133 // CHECK-ARMV7EL-NOT: "--be8"
135 // RUN: %clang -### %s --target=armebv7-none-eabi -mlittle-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
136 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s
138 // RUN: %clang -### %s --target=armv7-none-eabi -mlittle-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
139 // RUN: | FileCheck --check-prefix=CHECK-ARMV7EL %s
141 // RUN: %clang -### %s --target=aarch64_be-none-elf --sysroot=%S/Inputs/baremetal_arm 2>&1 \
142 // RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s
143 // CHECK-AARCH64BE: "{{.*}}ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EB"
144 // CHECK-AARCH64BE-NOT: "--be8"
146 // RUN: %clang -### %s --target=aarch64-none-elf -mbig-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
147 // RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s
149 // RUN: %clang -### %s --target=aarch64_be-none-elf -mbig-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
150 // RUN: | FileCheck --check-prefix=CHECK-AARCH64BE %s
152 // RUN: %clang -### %s --target=aarch64-none-elf --sysroot=%S/Inputs/baremetal_arm 2>&1 \
153 // RUN: | FileCheck --check-prefix=CHECK-AARCH64LE %s
154 // CHECK-AARCH64LE: "{{.*}}ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic" "-EL"
155 // CHECK-AARCH64LE-NOT: "--be8"
157 // RUN: %clang -### %s --target=aarch64_be-none-elf -mlittle-endian --sysroot=%S/Inputs/baremetal_arm 2>&1 \
158 // RUN: | FileCheck --check-prefix=CHECK-AARCH64LE %s
160 // RUN: %clang -no-canonical-prefixes %s -### --target=aarch64-none-elf 2>&1 \
161 // RUN: | FileCheck --check-prefix=CHECK-AARCH64-NO-HOST-INC %s
162 // Verify that the bare metal driver does not include any host system paths:
163 // CHECK-AARCH64-NO-HOST-INC: InstalledDir: [[INSTALLEDDIR:.+]]
164 // CHECK-AARCH64-NO-HOST-INC: "-resource-dir" "[[RESOURCE:[^"]+]]"
165 // CHECK-AARCH64-NO-HOST-INC-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include{{[/\\]+}}c++{{[/\\]+}}v1"
166 // CHECK-AARCH64-NO-HOST-INC-SAME: "-internal-isystem" "[[RESOURCE]]{{[/\\]+}}include"
167 // CHECK-AARCH64-NO-HOST-INC-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include"
169 // RUN: %clang %s -### --target=riscv64-unknown-elf -o %t.out -L some/directory/user/asked/for \
170 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf 2>&1 \
171 // RUN: | FileCheck --check-prefix=CHECK-RV64 %s
172 // CHECK-RV64: "-cc1" "-triple" "riscv64-unknown-unknown-elf"
173 // CHECK-RV64-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
174 // CHECK-RV64-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
175 // CHECK-RV64-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
176 // CHECk-RV64-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include"
177 // CHECK-RV64-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
178 // CHECK-RV64-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
179 // CHECK-RV64-SAME: "-Lsome{{[/\\]+}}directory{{[/\\]+}}user{{[/\\]+}}asked{{[/\\]+}}for"
180 // CHECK-RV64-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib"
181 // CHECK-RV64-SAME: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
182 // CHECK-RV64-SAME: "-lc" "-lm" "-lclang_rt.builtins-riscv64" "-X" "-o" "{{.*}}.tmp.out"
184 // RUN: %clangxx %s -### --target=riscv64-unknown-elf 2>&1 \
185 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
186 // RUN: | FileCheck --check-prefix=CHECK-RV64-DEFAULTCXX %s
187 // CHECK-RV64-DEFAULTCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
188 // CHECK-RV64-DEFAULTCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
189 // CHECK-RV64-DEFAULTCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib"
190 // CHECK-RV64-DEFAULTCXX-SAME: "-L[[RESOURCE_DIR]]{{.*}}{{[/\\]+}}lib{{[/\\]+}}baremetal"
191 // CHECK-RV64-DEFAULTCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
192 // CHECK-RV64-DEFAULTCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-riscv64" "-X" "-o" "a.out"
194 // RUN: %clangxx %s -### --target=riscv64-unknown-elf 2>&1 \
195 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
196 // RUN: -stdlib=libc++ \
197 // RUN: | FileCheck --check-prefix=CHECK-RV64-LIBCXX %s
198 // CHECK-RV64-LIBCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
199 // CHECK-RV64-LIBCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}{{[^v].*}}"
200 // CHECK-RV64-LIBCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
201 // CHECK-RV64-LIBCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
202 // CHECK-RV64-LIBCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib"
203 // CHECK-RV64-LIBCXX-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
204 // CHECK-RV64-LIBCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
205 // CHECK-RV64-LIBCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-riscv64" "-X" "-o" "a.out"
207 // RUN: %clangxx %s -### 2>&1 --target=riscv64-unknown-elf \
208 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
209 // RUN: -stdlib=libstdc++ \
210 // RUN: | FileCheck --check-prefix=CHECK-RV64-LIBSTDCXX %s
211 // CHECK-RV64-LIBSTDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
212 // CHECK-RV64-LIBSTDCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
213 // CHECK-RV64-LIBSTDCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}8.0.1"
214 // CHECK-RV64-LIBSTDCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
215 // CHECK-RV64-LIBSTDCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib"
216 // CHECK-RV64-LIBSTDCXX-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
217 // CHECK-RV64-LIBSTDCXX-SAME: "-lstdc++" "-lsupc++" "-lunwind"
218 // CHECK-RV64-LIBSTDCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-riscv64" "-X" "-o" "a.out"
220 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
221 // RUN: -L some/directory/user/asked/for \
222 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
223 // RUN: | FileCheck --check-prefix=CHECK-RV32 %s
224 // CHECK-RV32: "-cc1" "-triple" "riscv32-unknown-unknown-elf"
225 // CHECK-RV32-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
226 // CHECK-RV32-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
227 // CHECK-RV32-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
228 // CHECK-RV32-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}include"
229 // CHECK-RV32-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
230 // CHECK-RV32-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
231 // CHECK-RV32-SAME: "-Lsome{{[/\\]+}}directory{{[/\\]+}}user{{[/\\]+}}asked{{[/\\]+}}for"
232 // CHECK-RV32-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}lib"
233 // CHECK-RV32-SAME: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
234 // CHECK-RV32-SAME: "-lc" "-lm" "-lclang_rt.builtins-riscv32" "-X" "-o" "a.out"
236 // RUN: %clangxx %s -### 2>&1 --target=riscv32-unknown-elf \
237 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
238 // RUN: | FileCheck --check-prefix=CHECK-RV32-DEFAULTCXX %s
239 // CHECK-RV32-DEFAULTCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
240 // CHECK-RV32-DEFAULTCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
241 // CHECK-RV32-DEFAULTCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv32_tree{{[/\\]+}}riscv32-unknown-elf{{[/\\]+}}lib"
242 // CHECK-RV32-DEFAULTCXX-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
243 // CHECK-RV32-DEFAULTCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
244 // CHECK-RV32-DEFAULTCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-riscv32" "-X" "-o" "a.out"
246 // RUN: %clangxx %s -### 2>&1 --target=riscv32-unknown-elf \
247 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
248 // RUN: -stdlib=libc++ \
249 // RUN: | FileCheck --check-prefix=CHECK-RV32-LIBCXX %s
250 // CHECK-RV32-LIBCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
251 // CHECK-RV32-LIBCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}{{[^v].*}}"
252 // CHECK-RV32-LIBCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
253 // CHECK-RV32-LIBCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
254 // CHECK-RV32-LIBCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv32_tree{{[/\\]+}}riscv32-unknown-elf{{[/\\]+}}lib"
255 // CHECK-RV32-LIBCXX-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
256 // CHECK-RV32-LIBCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
257 // CHECK-RV32-LIBCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-riscv32" "-X" "-o" "a.out"
259 // RUN: %clangxx %s -### 2>&1 --target=riscv32-unknown-elf \
260 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
261 // RUN: -stdlib=libstdc++ \
262 // RUN: | FileCheck --check-prefix=CHECK-RV32-LIBSTDCXX %s
263 // CHECK-RV32-LIBSTDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
264 // CHECK-RV32-LIBSTDCXX-NOT: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
265 // CHECK-RV32-LIBSTDCXX-SAME: "-internal-isystem" "{{[^"]+}}{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}8.0.1"
266 // CHECK-RV32-LIBSTDCXX: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
267 // CHECK-RV32-LIBSTDCXX-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv32_tree{{[/\\]+}}riscv32-unknown-elf{{[/\\]+}}lib"
268 // CHECK-RV32-LIBSTDCXX-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
269 // CHECK-RV32-LIBSTDCXX-SAME: "-lstdc++" "-lsupc++" "-lunwind"
270 // CHECK-RV32-LIBSTDCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-riscv32" "-X" "-o" "a.out"
272 // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf \
273 // RUN: -nostdlibinc -nobuiltininc \
274 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
275 // RUN: | FileCheck --check-prefix=CHECK-RV64-LIBINC %s
277 // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf -nostdinc \
278 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
279 // RUN: | FileCheck --check-prefix=CHECK-RV64-LIBINC %s
280 // CHECK-RV64-LIBINC-NOT: "-internal-isystem"
282 // RUN: %clangxx %s -### 2>&1 --target=riscv64-unknown-elf \
283 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
284 // RUN: -nodefaultlibs \
285 // RUN: | FileCheck --check-prefix=CHECK-RV64-NDL %s
286 // CHECK-RV64-NDL: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
287 // CHECK-RV64-NDL: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
288 // CHECK-RV64-NDL-SAME: "-L{{[^"]*}}{{[/\\]+}}Inputs{{[/\\]+}}basic_riscv64_tree{{[/\\]+}}riscv64-unknown-elf{{[/\\]+}}lib"
289 // CHECK-RV64-NDL-SAME: "-L[[RESOURCE_DIR]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
291 // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf \
292 // RUN: -march=rv64imafdc -mabi=lp64d \
293 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
294 // RUN: | FileCheck --check-prefix=CHECK-RV64FD %s
296 // RUN: %clang %s -### 2>&1 --target=riscv64-unknown-elf \
297 // RUN: -march=rv64gc -mabi=lp64d \
298 // RUN: --sysroot=%S/Inputs/basic_riscv64_tree/riscv64-unknown-elf \
299 // RUN: | FileCheck --check-prefix=CHECK-RV64FD %s
301 // CHECK-RV64FD: "-cc1" "-triple" "riscv64-unknown-unknown-elf"
302 // CHECK-RV64FD-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
303 // CHECK-RV64FD-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
304 // CHECK-RV64FD-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv64imafdc{{[/\\]+}}lp64d{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
305 // CHECk-RV64FD-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv64imafdc{{[/\\]+}}lp64d{{[/\\]+}}include"
306 // CHECK-RV64FD-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
307 // CHECK-RV64FD-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
308 // CHECK-RV64FD-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv64imafdc{{[/\\]+}}lp64d{{[/\\]+}}lib"
309 // CHECK-RV64FD-SAME: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}baremetal{{[/\\]+}}rv64imafdc{{[/\\]+}}lp64d"
311 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
312 // RUN: -march=rv32i -mabi=ilp32 \
313 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
314 // RUN: | FileCheck --check-prefix=CHECK-RV32I %s
316 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
317 // RUN: -march=rv32ic -mabi=ilp32 \
318 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
319 // RUN: | FileCheck --check-prefix=CHECK-RV32I %s
321 // CHECK-RV32I: "-cc1" "-triple" "riscv32-unknown-unknown-elf"
322 // CHECK-RV32I-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
323 // CHECK-RV32I-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
324 // CHECK-RV32I-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32i{{[/\\]+}}ilp32{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
325 // CHECK-RV32I-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32i{{[/\\]+}}ilp32{{[/\\]+}}include"
326 // CHECK-RV32I-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
327 // CHECK-RV32I-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
328 // CHECK-RV32I-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv32i{{[/\\]+}}ilp32{{[/\\]+}}lib"
329 // CHECK-RV32I-SAME: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}baremetal{{[/\\]+}}rv32i{{[/\\]+}}ilp32"
331 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
332 // RUN: -march=rv32im -mabi=ilp32 \
333 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
334 // RUN: | FileCheck --check-prefix=CHECK-RV32IM %s
336 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
337 // RUN: -march=rv32imc -mabi=ilp32 \
338 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
339 // RUN: | FileCheck --check-prefix=CHECK-RV32IM %s
341 // CHECK-RV32IM: "-cc1" "-triple" "riscv32-unknown-unknown-elf"
342 // CHECK-RV32IM-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
343 // CHECK-RV32IM-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
344 // CHECK-RV32IM-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32im{{[/\\]+}}ilp32{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
345 // CHECK-RV32IM-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32im{{[/\\]+}}ilp32{{[/\\]+}}include"
346 // CHECK-RV32IM-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
347 // CHECK-RV32IM-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
348 // CHECK-RV32IM-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv32im{{[/\\]+}}ilp32{{[/\\]+}}lib"
349 // CHECK-RV32IM-SAME: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}baremetal{{[/\\]+}}rv32im{{[/\\]+}}ilp32"
351 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf \
352 // RUN: -march=rv32iac -mabi=ilp32 \
353 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
354 // RUN: | FileCheck --check-prefix=CHECK-RV32IAC %s
356 // CHECK-RV32IAC: "-cc1" "-triple" "riscv32-unknown-unknown-elf"
357 // CHECK-RV32IAC-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
358 // CHECK-RV32IAC-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
359 // CHECK-RV32IAC-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32iac{{[/\\]+}}ilp32{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
360 // CHECK-RV32IAC-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32iac{{[/\\]+}}ilp32{{[/\\]+}}include"
361 // CHECK-RV32IAC-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
362 // CHECK-RV32IAC-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
363 // CHECK-RV32IAC-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv32iac{{[/\\]+}}ilp32{{[/\\]+}}lib"
364 // CHECK-RV32IAC-SAME: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}baremetal{{[/\\]+}}rv32iac{{[/\\]+}}ilp32"
366 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf -march=rv32imafc -mabi=ilp32f \
367 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
368 // RUN: | FileCheck --check-prefix=CHECK-RV32IMAFC %s
370 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf -march=rv32imafdc -mabi=ilp32f \
371 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
372 // RUN: | FileCheck --check-prefix=CHECK-RV32IMAFC %s
374 // RUN: %clang %s -### 2>&1 --target=riscv32-unknown-elf -march=rv32gc -mabi=ilp32f \
375 // RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf \
376 // RUN: | FileCheck --check-prefix=CHECK-RV32IMAFC %s
378 // CHECK-RV32IMAFC: "-cc1" "-triple" "riscv32-unknown-unknown-elf"
379 // CHECK-RV32IMAFC-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
380 // CHECK-RV32IMAFC-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
381 // CHECK-RV32IMAFC-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32imafc{{[/\\]+}}ilp32f{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
382 // CHECK-RV32IMAFC-SAME: "-internal-isystem" "[[SYSROOT]]{{[/\\]+}}rv32imafc{{[/\\]+}}ilp32f{{[/\\]+}}include"
383 // CHECK-RV32IMAFC-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
384 // CHECK-RV32IMAFC-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
385 // CHECK-RV32IMAFC-SAME: "-L[[SYSROOT:[^"]+]]{{[/\\]+}}rv32imafc{{[/\\]+}}ilp32f{{[/\\]+}}lib"
386 // CHECK-RV32IMAFC-SAME: "-L[[RESOURCE_DIR:[^"]+]]{{[/\\]+}}lib{{[/\\]+}}baremetal{{[/\\]+}}rv32imafc{{[/\\]+}}ilp32f"
388 // RUN: %clang -no-canonical-prefixes %s -### --target=powerpc-unknown-eabi 2>&1 \
389 // RUN: | FileCheck --check-prefix=CHECK-PPCEABI %s
390 // CHECK-PPCEABI: InstalledDir: [[INSTALLEDDIR:.+]]
391 // CHECK-PPCEABI: "-nostdsysteminc"
392 // CHECK-PPCEABI-SAME: "-resource-dir" "[[RESOURCE:[^"]+]]"
393 // CHECK-PPCEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include{{[/\\]+}}c++{{[/\\]+}}v1"
394 // CHECK-PPCEABI-SAME: "-internal-isystem" "[[RESOURCE]]{{[/\\]+}}include"
395 // CHECK-PPCEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include"
396 // CHECK-PPCEABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
397 // CHECK-PPCEABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib"
398 // CHECK-PPCEABI-SAME: "-L[[RESOURCE]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
399 // CHECK-PPCEABI-SAME: "-lc" "-lm" "-lclang_rt.builtins-powerpc" "-o" "a.out"
401 // RUN: %clang -no-canonical-prefixes %s -### --target=powerpc64-unknown-eabi 2>&1 \
402 // RUN: | FileCheck --check-prefix=CHECK-PPC64EABI %s
403 // CHECK-PPC64EABI: InstalledDir: [[INSTALLEDDIR:.+]]
404 // CHECK-PPC64EABI: "-nostdsysteminc"
405 // CHECK-PPC64EABI-SAME: "-resource-dir" "[[RESOURCE:[^"]+]]"
406 // CHECK-PPC64EABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include{{[/\\]+}}c++{{[/\\]+}}v1"
407 // CHECK-PPC64EABI-SAME: "-internal-isystem" "[[RESOURCE]]{{[/\\]+}}include"
408 // CHECK-PPC64EABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include"
409 // CHECK-PPC64EABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
410 // CHECK-PPC64EABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib"
411 // CHECK-PPC64EABI-SAME: "-L[[RESOURCE]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
412 // CHECK-PPC64EABI-SAME: "-lc" "-lm" "-lclang_rt.builtins-powerpc64" "-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: "-L[[RESOURCE]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
425 // CHECK-PPCLEEABI-SAME: "-lc" "-lm" "-lclang_rt.builtins-powerpcle" "-o" "a.out"
427 // RUN: %clang -no-canonical-prefixes %s -### --target=powerpc64le-unknown-eabi 2>&1 \
428 // RUN: | FileCheck --check-prefix=CHECK-PPC64LEEABI %s
429 // CHECK-PPC64LEEABI: InstalledDir: [[INSTALLEDDIR:.+]]
430 // CHECK-PPC64LEEABI: "-nostdsysteminc"
431 // CHECK-PPC64LEEABI-SAME: "-resource-dir" "[[RESOURCE:[^"]+]]"
432 // CHECK-PPC64LEEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include{{[/\\]+}}c++{{[/\\]+}}v1"
433 // CHECK-PPC64LEEABI-SAME: "-internal-isystem" "[[RESOURCE]]{{[/\\]+}}include"
434 // CHECK-PPC64LEEABI-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}include"
435 // CHECK-PPC64LEEABI-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
436 // CHECK-PPC64LEEABI-SAME: "-L[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+[^"]*}}lib"
437 // CHECK-PPC64LEEABI-SAME: "-L[[RESOURCE]]{{[/\\]+}}lib{{[/\\]+}}baremetal"
438 // CHECK-PPC64LEEABI-SAME: "-lc" "-lm" "-lclang_rt.builtins-powerpc64le" "-o" "a.out"
440 // Check that compiler-rt library without the arch filename suffix will
441 // be used if present.
442 // RUN: rm -rf %T/baremetal_clang_rt_noarch
443 // RUN: mkdir -p %T/baremetal_clang_rt_noarch/lib
444 // RUN: touch %T/baremetal_clang_rt_noarch/lib/libclang_rt.builtins.a
445 // RUN: %clang %s -### 2>&1 \
446 // RUN: --target=armv6m-none-eabi \
447 // RUN: --sysroot=%T/baremetal_clang_rt_noarch \
448 // RUN: | FileCheck --check-prefix=CHECK-CLANGRT-NOARCH %s
449 // CHECK-CLANGRT-NOARCH: "-lclang_rt.builtins"
450 // CHECK-CLANGRT-NOARCH-NOT: "-lclang_rt.builtins-armv6m"
452 // Check that compiler-rt library with the arch filename suffix will be
453 // used if present.
454 // RUN: rm -rf %T/baremetal_clang_rt_arch
455 // RUN: mkdir -p %T/baremetal_clang_rt_arch/lib
456 // RUN: touch %T/baremetal_clang_rt_arch/lib/libclang_rt.builtins-armv6m.a
457 // RUN: %clang %s -### 2>&1 \
458 // RUN: --target=armv6m-none-eabi \
459 // RUN: --sysroot=%T/baremetal_clang_rt_arch \
460 // RUN: | FileCheck --check-prefix=CHECK-CLANGRT-ARCH %s
461 // CHECK-CLANGRT-ARCH: "-lclang_rt.builtins-armv6m"
462 // CHECK-CLANGRT-ARCH-NOT: "-lclang_rt.builtins"