Thanks for the suggestion. The target selector method can not cover some cases.
On 2023/12/12 18:05, juzhe.zh...@rivai.ai wrote: > A more reasonable solution is the add riscv_vector.h into > gcc.dg/vect/costmodel/riscv/rvv > with the following codes in riscv_vector.h: > > /* Wrapper of riscv_vector.h, prevent riscv_vector.h including stdint.h from > C library, that might cause problem on testing RV32 related testcase when > we disable multilib. */ > #ifndef _RISCV_VECTOR_WRAP_H > > #define _GCC_WRAP_STDINT_H > #include "stdint-gcc.h" > #include_next <riscv_vector.h> > #define _RISCV_VECTOR_WRAP_H > > #endif > > > > juzhe.zh...@rivai.ai > > From: demin.han > Date: 2023-12-12 18:01 > To: gcc-patches@gcc.gnu.org > CC: juzhe.zh...@rivai.ai; pan2...@intel.com > Subject: [PATCH] RISC-V: Fix dynamic lmul tests depended on abi > These two tests depend on -mabi. > Other toolchain configs would report: > fatal error: gnu/stubs-ilp32.h: No such file or directory > > gcc/testsuite/ChangeLog: > > * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c: Fix abi issue > * gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c: Ditto > > Signed-off-by: demin.han <demin....@starfivetech.com> > --- > .../gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c | 4 +++- > .../gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c | 4 +++- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c > b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c > index 8e6610b0e11..7fd397b782e 100644 > --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c > +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul1-7.c > @@ -1,5 +1,7 @@ > /* { dg-do compile } */ > -/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3 -ftree-vectorize --param > riscv-autovec-lmul=dynamic -Wno-psabi -fdump-tree-vect-details" } */ > +/* { dg-options "-O3 -ftree-vectorize --param riscv-autovec-lmul=dynamic > -Wno-psabi -fdump-tree-vect-details" } */ > +/* { dg-additional-options "-march=rv32gcv" { target riscv32*-*-* } } */ > +/* { dg-additional-options "-march=rv64gcv" { target riscv64*-*-* } } */ > #include "riscv_vector.h" > diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c > b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c > index b3498ad8210..5fd27cb01e1 100644 > --- a/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c > +++ b/gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/dynamic-lmul2-4.c > @@ -1,5 +1,7 @@ > /* { dg-do compile } */ > -/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3 -ftree-vectorize --param > riscv-autovec-lmul=dynamic -fdump-tree-vect-details" } */ > +/* { dg-options "-O3 -ftree-vectorize --param riscv-autovec-lmul=dynamic > -fdump-tree-vect-details" } */ > +/* { dg-additional-options "-march=rv32gcv" { target riscv32*-*-* } } */ > +/* { dg-additional-options "-march=rv64gcv" { target riscv64*-*-* } } */ > #include "riscv_vector.h"