diff mbox series

RISC-V: skip vector tests if target not supporting v extension

Message ID 20240711072023.80301-1-jerry.zhangjian@sifive.com
State New
Headers show
Series RISC-V: skip vector tests if target not supporting v extension | expand

Commit Message

Jerry Zhang Jian July 11, 2024, 7:20 a.m. UTC
The original method tried to overwrite the march option when the target
doesn't support v exctension, which caused unexpected compile and
runtime test failures

This patch change the way to handle targets that don't support v
extension by simply skip the test cases that requires v extension

The test cases under g[cc|++].dg/vect/vect.exp will be skipped on rv64gc after this patch

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp: skip vector tests if target not supporting v extension

Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
---
 gcc/testsuite/lib/target-supports.exp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Jeff Law July 11, 2024, 4:27 p.m. UTC | #1
On 7/11/24 1:20 AM, Jerry Zhang Jian wrote:
> The original method tried to overwrite the march option when the target
> doesn't support v exctension, which caused unexpected compile and
> runtime test failures
> 
> This patch change the way to handle targets that don't support v
> extension by simply skip the test cases that requires v extension
> 
> The test cases under g[cc|++].dg/vect/vect.exp will be skipped on rv64gc after this patch
> 
> gcc/testsuite/ChangeLog:
> 
> 	* lib/target-supports.exp: skip vector tests if target not supporting v extension
But isn't the whole point of this code to inject the V flag so that we 
can run those tests, even on rv64gc?

Wouldn't it be better to understand why injection didn't work for you? 
Others certainly run testsuites on rv64gc without needing to skip the 
vect.exp tests.

jeff
diff mbox series

Patch

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index f001c28072f..71d7e569a7d 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -11807,10 +11807,7 @@  proc check_vect_support_and_set_flags { } {
 		lappend DEFAULT_VECTCFLAGS "-mno-vector-strict-align"
 	    }
 	} else {
-	    foreach item [add_options_for_riscv_v ""] {
-		lappend DEFAULT_VECTCFLAGS $item
-	    }
-	    set dg-do-what-default compile
+	    return 0
 	}
     } elseif [istarget loongarch*-*-*] {
       # Set the default vectorization option to "-mlsx" due to the problem