|
215 | 215 |
|
216 | 216 | // RUN: %clang --target=riscv32 %s -emit-llvm -S -o - | FileCheck %s |
217 | 217 |
|
218 | | -// Check that "--no-relax" is forwarded to the linker for RISC-V. |
| 218 | +/// Check that "--no-relax" is forwarded to the linker for RISC-V. |
219 | 219 | // RUN: env "PATH=" %clang %s -### 2>&1 -mno-relax \ |
220 | 220 | // RUN: --target=riscv32-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ |
221 | 221 | // RUN: -march=rv32imac -mabi=lp32\ |
222 | 222 | // RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ |
223 | 223 | // RUN: | FileCheck --check-prefix=CHECK-RV32-NORELAX %s |
224 | 224 | // CHECK-RV32-NORELAX: "--no-relax" |
225 | 225 |
|
226 | | -// Check that "--no-relax" is not forwarded to the linker for RISC-V. |
| 226 | +/// Check that "--no-relax" is not forwarded to the linker for RISC-V. |
227 | 227 | // RUN:env "PATH=" %clang %s -### 2>&1 \ |
228 | 228 | // RUN: --target=riscv32-unknown-elf --rtlib=platform --unwindlib=platform --sysroot= \ |
229 | 229 | // RUN: -march=rv32imac -mabi=lp32\ |
230 | 230 | // RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk 2>&1 \ |
231 | 231 | // RUN: | FileCheck --check-prefix=CHECK-RV32-RELAX %s |
232 | 232 | // CHECK-RV32-RELAX-NOT: "--no-relax" |
233 | 233 |
|
234 | | -// Check that "--no-relax" is forwarded to the linker for RISC-V (Gnu.cpp). |
| 234 | +/// Check that "--no-relax" is forwarded to the linker for RISC-V (Gnu.cpp). |
235 | 235 | // RUN: env "PATH=" %clang -### %s -fuse-ld=ld -no-pie -mno-relax \ |
236 | 236 | // RUN: --target=riscv32-unknown-linux-gnu --rtlib=platform --unwindlib=platform -mabi=ilp32 \ |
237 | 237 | // RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \ |
238 | 238 | // RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \ |
239 | 239 | // RUN: | FileCheck -check-prefix=CHECK-RV32-GNU-NORELAX %s |
240 | 240 | // CHECK-RV32-GNU-NORELAX: "--no-relax" |
241 | 241 |
|
242 | | -// Check that "--no-relax" is not forwarded to the linker for RISC-V (Gnu.cpp). |
| 242 | +/// Check that "--no-relax" is not forwarded to the linker for RISC-V (Gnu.cpp). |
243 | 243 | // RUN: env "PATH=" %clang -### %s -fuse-ld=ld -no-pie \ |
244 | 244 | // RUN: --target=riscv32-unknown-linux-gnu --rtlib=platform --unwindlib=platform -mabi=ilp32 \ |
245 | 245 | // RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_linux_sdk \ |
246 | 246 | // RUN: --sysroot=%S/Inputs/multilib_riscv_linux_sdk/sysroot 2>&1 \ |
247 | 247 | // RUN: | FileCheck -check-prefix=CHECK-RV32-GNU-RELAX %s |
248 | 248 | // CHECK-RV32-GNU-RELAX-NOT: "--no-relax" |
249 | 249 |
|
| 250 | +/// Check that "-static -pie" is forwarded to linker when "-static-pie" is used |
| 251 | +// RUN: %clang -static-pie -### %s -fuse-ld= \ |
| 252 | +// RUN: --target=riscv32-unknown-elf -rtlib=platform --unwindlib=platform \ |
| 253 | +// RUN: --gcc-toolchain=%S/Inputs/basic_riscv32_tree \ |
| 254 | +// RUN: --sysroot=%S/Inputs/basic_riscv32_tree/riscv32-unknown-elf 2>&1 \ |
| 255 | +// RUN: | FileCheck -check-prefix=C-RV32-STATIC-PIE %s |
| 256 | + |
| 257 | +// C-RV32-STATIC-PIE: "-Bstatic" "-pie" "--no-dynamic-linker" "-z" "text" "-m" "elf32lriscv" "-X" |
| 258 | +// C-RV32-STATIC-PIE: "{{.*}}rcrt1.o" |
| 259 | +// C-RV32-STATIC-PIE: "{{.*}}crtbeginS.o" |
| 260 | +// C-RV32-STATIC-PIE: "--start-group" "-lgcc" "-lc" "-lgloss" "--end-group" |
| 261 | +// C-RV32-STATIC-PIE: "{{.*}}crtendS.o" |
| 262 | + |
250 | 263 | typedef __builtin_va_list va_list; |
251 | 264 | typedef __SIZE_TYPE__ size_t; |
252 | 265 | typedef __PTRDIFF_TYPE__ ptrdiff_t; |
|
0 commit comments