The testcase makes the -march option conditional on rv64, and #errors
out if the desired CPU properties are not active.  This makes the test
fail on rv32.  Arrange to skip the test on rv32 instead, moving the
rv64 conditional.

Tested on x86_64-linux-gnu native, and gcc-14 target riscv{64,32}-elf.
Ok to install?


for  gcc/testsuite/ChangeLog

        * gcc.target/riscv/mcpu-xiangshan-nanhu.c: Skip on non-rv64.
---
 .../gcc.target/riscv/mcpu-xiangshan-nanhu.c        |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/riscv/mcpu-xiangshan-nanhu.c 
b/gcc/testsuite/gcc.target/riscv/mcpu-xiangshan-nanhu.c
index 2903c88d91c86..c2a374f54fc86 100644
--- a/gcc/testsuite/gcc.target/riscv/mcpu-xiangshan-nanhu.c
+++ b/gcc/testsuite/gcc.target/riscv/mcpu-xiangshan-nanhu.c
@@ -1,6 +1,6 @@
-/* { dg-do compile } */
+/* { dg-do compile { target { rv64 } } } */
 /* { dg-skip-if "-march given" { *-*-* } { "-march=*" } } */
-/* { dg-options "-mcpu=xiangshan-nanhu" { target { rv64 } } } */
+/* { dg-options "-mcpu=xiangshan-nanhu" } */
 /* XiangShan Nanhu => rv64imafdc_zba_zbb_zbc_zbs_zbkb_zbkc_zbkx_zknd
                       _zkne_zknh_zksed_zksh_svinval_zicbom_zicboz */
 

-- 
Alexandre Oliva, happy hacker            https://blog.lx.oliva.nom.br/
Free Software Activist     FSFLA co-founder     GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!

Reply via email to