RISC-V: testsuite: fix target selector for sync_char_short

Message ID 20250109183344.793286-1-ewlu@rivosinc.com
State Committed
Headers
Series RISC-V: testsuite: fix target selector for sync_char_short |

Checks

Context Check Description
rivoscibot/toolchain-ci-rivos-apply-patch success Patch applied
rivoscibot/toolchain-ci-rivos-lint success Lint passed
rivoscibot/toolchain-ci-rivos-build--newlib-rv64gcv-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gc_zba_zbb_zbc_zbs-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gcv-lp64d-multilib success Build passed
rivoscibot/toolchain-ci-rivos-test success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply

Commit Message

Edwin Lu Jan. 9, 2025, 6:33 p.m. UTC
  The effective-target selector for riscv on sync_char_short did not
check to see if atomics were enabled. As a result, these test cases were
ran on targets without the a extension. Add additional checks for zalrsc
or zabha extensions.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp: Fix effective target sync_char_short
	for riscv*-*-*

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
---
 gcc/testsuite/lib/target-supports.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Jeff Law Jan. 9, 2025, 9:04 p.m. UTC | #1
On 1/9/25 11:33 AM, Edwin Lu wrote:
> The effective-target selector for riscv on sync_char_short did not
> check to see if atomics were enabled. As a result, these test cases were
> ran on targets without the a extension. Add additional checks for zalrsc
> or zabha extensions.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* lib/target-supports.exp: Fix effective target sync_char_short
> 	for riscv*-*-*
OK
jeff
  
Edwin Lu Jan. 9, 2025, 10:12 p.m. UTC | #2
Thanks! Committed.

Edwin

On 1/9/2025 1:04 PM, Jeff Law wrote:
>
>
> On 1/9/25 11:33 AM, Edwin Lu wrote:
>> The effective-target selector for riscv on sync_char_short did not
>> check to see if atomics were enabled. As a result, these test cases were
>> ran on targets without the a extension. Add additional checks for zalrsc
>> or zabha extensions.
>>
>> gcc/testsuite/ChangeLog:
>>
>>     * lib/target-supports.exp: Fix effective target sync_char_short
>>     for riscv*-*-*
> OK
> jeff
>
  

Patch

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index a89f531f887..939ef3a4119 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -10080,7 +10080,9 @@  proc check_effective_target_sync_char_short { } {
 	     || ([istarget sparc*-*-*] && [check_effective_target_sparc_v9])
 	     || ([istarget arc*-*-*] && [check_effective_target_arc_atomic])
 	     || [istarget loongarch*-*-*]
-	     || [istarget riscv*-*-*]
+	     || ([istarget riscv*-*-*]
+		 && ([check_effective_target_riscv_zalrsc]
+		     || [check_effective_target_riscv_zabha]))
 	     || [check_effective_target_mips_llsc] }}]
 }