I forgot to send this to the list :(.
-------- Forwarded Message --------
From: Xi Ruoyao <[email protected]>
To: Alexandre Oliva <[email protected]>
Cc: Xi Ruoyao <[email protected]>
Subject: [PATCH] testsuite: Fix up dg-do-if
Date: 05/26/25 17:59:32
The line number needs to be passed to dg-do, instead of being stripped.
Fixes 'compile: syntax error for " dg-do-if 1 compile { target {
sse2_runtime && { ! sse4_runtime } } } "' errors in
vect-simd-clone-{16f,17f,18f,20}.c on an old K8.
gcc/testsuite/ChangeLog:
* lib/target-supports-dg.exp (dg-do-if): Pass the line number
to
dg-do.
---
Ok for trunk and gcc-15 branch?
gcc/testsuite/lib/target-supports-dg.exp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/gcc/testsuite/lib/target-supports-dg.exp
b/gcc/testsuite/lib/target-supports-dg.exp
index 422ea838084..2dca8e15c42 100644
--- a/gcc/testsuite/lib/target-supports-dg.exp
+++ b/gcc/testsuite/lib/target-supports-dg.exp
@@ -422,9 +422,8 @@ proc check-flags { args } {
# (possibly the default) prevails.
proc dg-do-if { args } {
- set args [lreplace $args 0 0]
# Verify the number of arguments.
- if { [llength $args] != 2 } {
+ if { [llength $args] != 3 } {
error "syntax error, need a single action and target selector"
}
@@ -435,7 +434,7 @@ proc dg-do-if { args } {
}
# Evaluate selector, return if it does not match.
- switch [dg-process-target-1 [lindex $args 1]] {
+ switch [dg-process-target-1 [lindex $args 2]] {
"N" { return }
"P" { return }
}
--
2.49.0
--
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University