Skip to content

Commit dec5faa

Browse files
Fix PR 106690: enable effective_target_bswap for RISCV targets with ZBB enabled by default
While looking for testcases to quickly test, I Noticed that check_effective_target_bswap was not enabled for riscv when ZBB is enabled. This patch checks if ZBB is enabled when targeting RISCV* for bswap. OK? Ran the testsuite for riscv32-linux-gnu both with and without ZBB enabled. PR testsuite/106690 gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_bswap): Return true if riscv and ZBB ISA extension is enabled.
1 parent e5e6983 commit dec5faa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gcc/testsuite/lib/target-supports.exp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8646,6 +8646,13 @@ proc check_effective_target_bswap { } {
86468646
|| [istarget powerpc*-*-*]
86478647
|| [istarget rs6000-*-*]
86488648
|| [istarget s390*-*-*]
8649+
|| ([istarget riscv*-*-*]
8650+
&& [check_no_compiler_messages_nocache riscv_zbb object {
8651+
#if __riscv_zbb <= 0
8652+
#error ZBB is not enabled
8653+
#endif
8654+
int i;
8655+
} ""])
86498656
|| ([istarget arm*-*-*]
86508657
&& [check_no_compiler_messages_nocache arm_v6_or_later object {
86518658
#if __ARM_ARCH < 6

0 commit comments

Comments
 (0)