diff mbox

testsuite] clean up convoluted dg-final directive in vect-multitypes-12.c

Message ID mvmk3r3rlei.fsf@hawking.suse.de
State New
Headers show

Commit Message

Andreas Schwab Jan. 24, 2013, 9:16 a.m. UTC
Eric Botcazou <ebotcazou@adacore.com> writes:

> ERROR: gcc.dg/vect/vect-multitypes-12.c: error executing dg-final: bad index 
> "18-1": must be integer or end?-integer?

Does that help?  Perhaps the M-N feature isn't supported by your version
of tcl.

	* lib/target-supports-dg.exp (dg-process-target): Use expr to
	evaluate the end index in string range.


Andreas.

Comments

Jakub Jelinek Jan. 30, 2013, 8:28 a.m. UTC | #1
On Thu, Jan 24, 2013 at 10:16:21AM +0100, Andreas Schwab wrote:
> Eric Botcazou <ebotcazou@adacore.com> writes:
> 
> > ERROR: gcc.dg/vect/vect-multitypes-12.c: error executing dg-final: bad index 
> > "18-1": must be integer or end?-integer?
> 
> Does that help?  Perhaps the M-N feature isn't supported by your version
> of tcl.
> 
> 	* lib/target-supports-dg.exp (dg-process-target): Use expr to
> 	evaluate the end index in string range.

Yes, this seems to help for tcl 8.4.13 and works also with 8.5.11 (where it
worked before too).

So, ok for trunk, thanks.

> --- a/gcc/testsuite/lib/target-supports-dg.exp
> +++ b/gcc/testsuite/lib/target-supports-dg.exp
> @@ -586,7 +586,7 @@ if { [info procs saved-dg-process-target] == [list] } {
>  	if [regexp "^target .* xfail .*" $selector] {
>  	    set xfail_index [string first "xfail" $selector]
>  	    set xfail_selector [string range $selector $xfail_index end]
> -	    set target_selector [string range $selector 0 $xfail_index-1]
> +	    set target_selector [string range $selector 0 [expr $xfail_index-1]]
>  	    set target_selector [string trim $target_selector]
>  	    if { [dg-process-target-1 $target_selector] == "N" } {
>  		return "N"

	Jakub
diff mbox

Patch

diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp
index fffd8bb..1b56536 100644
--- a/gcc/testsuite/lib/target-supports-dg.exp
+++ b/gcc/testsuite/lib/target-supports-dg.exp
@@ -586,7 +586,7 @@  if { [info procs saved-dg-process-target] == [list] } {
 	if [regexp "^target .* xfail .*" $selector] {
 	    set xfail_index [string first "xfail" $selector]
 	    set xfail_selector [string range $selector $xfail_index end]
-	    set target_selector [string range $selector 0 $xfail_index-1]
+	    set target_selector [string range $selector 0 [expr $xfail_index-1]]
 	    set target_selector [string trim $target_selector]
 	    if { [dg-process-target-1 $target_selector] == "N" } {
 		return "N"