-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recommit [RISCV] Implement multi-lib reuse rule for RISC-V bare-metal…
… toolchain (#73765) (#75890) Extend the multi-lib re-use selection mechanism for RISC-V. This funciton will try to re-use multi-lib if they are compatible. Definition of compatible: - ABI must be the same. - multi-lib is a subset of current arch, e.g. multi-lib=march=rv32im is a subset of march=rv32imc. - march that contains atomic extension can't reuse multi-lib that doesn't has atomic, vice versa. e.g. multi-lib=march=rv32im and march=rv32ima are not compatible, because software and hardware atomic operation can't work together correctly.
- Loading branch information
Showing
2 changed files
with
207 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// RUN: %clang %s \ | ||
// RUN: -target riscv64-unknown-elf \ | ||
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \ | ||
// RUN: --print-multi-directory \ | ||
// RUN: -march=rv32imc -mabi=ilp32 \ | ||
// RUN: | FileCheck -check-prefix=GCC-MULTI-LIB-REUSE-RV32IMC-ILP32 %s | ||
// GCC-MULTI-LIB-REUSE-RV32IMC-ILP32: rv32im/ilp32 | ||
// GCC-MULTI-LIB-REUSE-RV32IMC-ILP32-NOT: {{^.+$}} | ||
|
||
// Check rv32imac won't reuse rv32im or rv32ic | ||
// RUN: %clang %s \ | ||
// RUN: -target riscv64-unknown-elf \ | ||
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \ | ||
// RUN: --print-multi-directory \ | ||
// RUN: -march=rv32imac -mabi=ilp32 \ | ||
// RUN: | FileCheck -check-prefix=GCC-MULTI-LIB-REUSE-RV32IMAC-ILP32 %s | ||
// GCC-MULTI-LIB-REUSE-RV32IMAC-ILP32: rv32imac/ilp32 | ||
// GCC-MULTI-LIB-REUSE-RV32IMAC-ILP32--NOT: {{^.+$}} | ||
|
||
// RUN: %clang %s \ | ||
// RUN: -target riscv64-unknown-elf \ | ||
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \ | ||
// RUN: --print-multi-directory \ | ||
// RUN: -march=rv32iac -mabi=ilp32 \ | ||
// RUN: | FileCheck -check-prefix=GCC-MULTI-LIB-REUSE-RV32IAC-ILP32 %s | ||
// GCC-MULTI-LIB-REUSE-RV32IAC-ILP32: rv32iac/ilp32 | ||
// GCC-MULTI-LIB-REUSE-RV32IAC-ILP32-NOT: {{^.+$}} | ||
|
||
// RUN: %clang %s \ | ||
// RUN: -target riscv64-unknown-elf \ | ||
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \ | ||
// RUN: --print-multi-directory \ | ||
// RUN: -march=rv32imafdc -mabi=ilp32f \ | ||
// RUN: | FileCheck -check-prefix=GCC-MULTI-LIB-REUSE-RV32IMAFDC-ILP32F %s | ||
// GCC-MULTI-LIB-REUSE-RV32IMAFDC-ILP32F: rv32imafc/ilp32f | ||
// GCC-MULTI-LIB-REUSE-RV32IMAFDC-ILP32F-NOT: {{^.+$}} | ||
|
||
// RUN: %clang %s \ | ||
// RUN: -target riscv64-unknown-elf \ | ||
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \ | ||
// RUN: --print-multi-directory \ | ||
// RUN: -march=rv32imafdc -mabi=ilp32d \ | ||
// RUN: | FileCheck -check-prefix=GCC-MULTI-LIB-REUSE-RV32IMAFDC-ILP32D %s | ||
// GCC-MULTI-LIB-REUSE-RV32IMAFDC-ILP32D: . | ||
// GCC-MULTI-LIB-REUSE-RV32IMAFDC-ILP32D-NOT: {{^.+$}} | ||
|
||
// RUN: %clang %s \ | ||
// RUN: -target riscv64-unknown-elf \ | ||
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \ | ||
// RUN: --print-multi-directory \ | ||
// RUN: -march=rv64imafc -mabi=lp64 \ | ||
// RUN: | FileCheck -check-prefix=GCC-MULTI-LIB-REUSE-RV64IMAFC-LP64 %s | ||
// GCC-MULTI-LIB-REUSE-RV64IMAFC-LP64: rv64imac/lp64 | ||
// GCC-MULTI-LIB-REUSE-RV64IMAFC-LP64-NOT: {{^.+$}} | ||
|
||
// RUN: %clang %s \ | ||
// RUN: -target riscv64-unknown-elf \ | ||
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \ | ||
// RUN: --print-multi-directory \ | ||
// RUN: -march=rv32imafc_zfh -mabi=ilp32 \ | ||
// RUN: | FileCheck -check-prefix=GCC-MULTI-LIB-REUSE-RV32IMAFC_ZFH-ILP32 %s | ||
// GCC-MULTI-LIB-REUSE-RV32IMAFC_ZFH-ILP32: rv32imac/ilp32 | ||
// GCC-MULTI-LIB-REUSE-RV32IMAFC_ZFH-ILP32-NOT: {{^.+$}} | ||
|
||
// RUN: %clang %s \ | ||
// RUN: -target riscv64-unknown-elf \ | ||
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \ | ||
// RUN: --print-multi-directory \ | ||
// RUN: -march=rv32i_zvkb -mabi=ilp32 \ | ||
// RUN: | FileCheck -check-prefix=GCC-MULTI-LIB-REUSE-RV32I_ZVKB-ILP32 %s | ||
// GCC-MULTI-LIB-REUSE-RV32I_ZVKB-ILP32: rv32i/ilp32 | ||
// GCC-MULTI-LIB-REUSE-RV32I_ZVKB-ILP32-NOT: {{^.+$}} | ||
|
||
// RUN: %clang %s \ | ||
// RUN: -target riscv64-unknown-elf \ | ||
// RUN: --gcc-toolchain=%S/Inputs/multilib_riscv_elf_sdk \ | ||
// RUN: --print-multi-directory \ | ||
// RUN: -march=rv64imfc -mabi=lp64 \ | ||
// RUN: | FileCheck -check-prefix=GCC-MULTI-LIB-REUSE-RV64IMFC-LP64 %s | ||
// GCC-MULTI-LIB-REUSE-RV64IMFC-LP64: . | ||
// GCC-MULTI-LIB-REUSE-RV64IMFC-LP64-NOT: {{^.+$}} |