> Anyhow, I'll be happy to restore the preexisting options, but limit
> their use to when the Zbs extension is available in the cpu under test.

> would it be ok for the options to not be applied while we'd still
> compile and run the test with whatever options the user selected for
> testing?

... like this


The test wants Zbs support, but it didn't check for runtime support
before enabling the options.  Adjust the test to compile with the
pedantic options that get enabled by default otherwise.

Also use rv64 and rv32 so that multilibs with different bit widths
work.


for  gcc/testsuite/ChangeLog

        * gcc.target/riscv/pr116715.c: Require Zbs support.  Select
        arch by active bitwidth.
---
 gcc/testsuite/gcc.target/riscv/pr116715.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.target/riscv/pr116715.c 
b/gcc/testsuite/gcc.target/riscv/pr116715.c
index 55daab20171ec..15bc738731790 100644
--- a/gcc/testsuite/gcc.target/riscv/pr116715.c
+++ b/gcc/testsuite/gcc.target/riscv/pr116715.c
@@ -1,16 +1,17 @@
 /* { dg-do run } */
-/* { dg-options "-march=rv64gc_zbs -mabi=lp64d" { target { riscv64*-*-* } } } 
*/
-/* { dg-options "-march=rv32gc_zbs -mabi=ilp32" { target { riscv32*-*-* } } } 
*/
+/* { dg-options "-march=rv64gc_zbs -mabi=lp64d" { target { rv64 && riscv_b_ok 
} } } */
+/* { dg-options "-march=rv32gc_zbs -mabi=ilp32" { target { rv32 && riscv_b_ok 
} } } */
 #include <stdint-gcc.h>
 int32_t a, b;
 int32_t d;
-int64_t f = 695372830942;
+int64_t f = (int64_t)695372 * 1000000 + 830942;
 int main() {
+  int64_t h;
   d = 0;
   for (; d < 1; d = 1)
     --f;
   d |= b = f;
-  int64_t h = d;
+  h = d;
   a = h >> 40;
   if (a != -1)
     __builtin_abort ();


-- 
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