public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* testsuite] clean up convoluted dg-final directive in vect-multitypes-12.c
@ 2013-01-18 17:02 Janis Johnson
  2013-01-23 22:53 ` Eric Botcazou
  0 siblings, 1 reply; 7+ messages in thread
From: Janis Johnson @ 2013-01-18 17:02 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

Test gcc.dg/vect/vect-multitypes uses Tcl conditions within a dg-final
directive, which is something that DejaGnu handles but we strive not to
do.  It's now possible to use supported constructs to get the same
result, so I've cleaned up the test and checked it in as obvious.  I'm
fixing this particular test because I want to add an xfail but want to
keep that change separate from the cleanup.

Janis

[-- Attachment #2: gcc-20130118-1 --]
[-- Type: text/plain, Size: 1026 bytes --]

2013-01-18  Janis Johnson  <janisjo@codesourcery.com>

	* gcc.dg/vect/vect-multitypes-12.c: Refactor dg-final directive.

Index: gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c	(revision 195286)
+++ gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c	(working copy)
@@ -38,7 +38,9 @@
   return 0;
 }
 
+/* bleah */
 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
-/* { dg-final { if [ istarget sparc*-*-* ] { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail ilp32 } } else { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_unpack } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target sparc*-*-* xfail ilp32 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { ! sparc*-*-* }  && { ! vect_unpack } } } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: testsuite] clean up convoluted dg-final directive in vect-multitypes-12.c
  2013-01-18 17:02 testsuite] clean up convoluted dg-final directive in vect-multitypes-12.c Janis Johnson
@ 2013-01-23 22:53 ` Eric Botcazou
  2013-01-23 23:36   ` Janis Johnson
  2013-01-24  9:16   ` Andreas Schwab
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Botcazou @ 2013-01-23 22:53 UTC (permalink / raw)
  To: janisjo; +Cc: gcc-patches

> Test gcc.dg/vect/vect-multitypes uses Tcl conditions within a dg-final
> directive, which is something that DejaGnu handles but we strive not to
> do.  It's now possible to use supported constructs to get the same
> result, so I've cleaned up the test and checked it in as obvious.  I'm
> fixing this particular test because I want to add an xfail but want to
> keep that change separate from the cleanup.

Something doesn't work anymore for SPARC though:

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

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: testsuite] clean up convoluted dg-final directive in vect-multitypes-12.c
  2013-01-23 22:53 ` Eric Botcazou
@ 2013-01-23 23:36   ` Janis Johnson
  2013-01-24  0:58     ` Eric Botcazou
  2013-01-24  9:16   ` Andreas Schwab
  1 sibling, 1 reply; 7+ messages in thread
From: Janis Johnson @ 2013-01-23 23:36 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: janisjo, gcc-patches

On 01/23/2013 02:52 PM, Eric Botcazou wrote:
>> Test gcc.dg/vect/vect-multitypes uses Tcl conditions within a dg-final
>> directive, which is something that DejaGnu handles but we strive not to
>> do.  It's now possible to use supported constructs to get the same
>> result, so I've cleaned up the test and checked it in as obvious.  I'm
>> fixing this particular test because I want to add an xfail but want to
>> keep that change separate from the cleanup.
> 
> Something doesn't work anymore for SPARC though:
> 
> ERROR: gcc.dg/vect/vect-multitypes-12.c: error executing dg-final: bad index 
> "18-1": must be integer or end?-integer?
> UNRESOLVED: gcc.dg/vect/vect-multitypes-12.c: error executing dg-final: bad 
> index "18-1": must be integer or end?-integer?
> ERROR: gcc.dg/vect/vect-multitypes-12.c -flto: error executing dg-final: bad 
> index "18-1": must be integer or end?-integer?
> UNRESOLVED: gcc.dg/vect/vect-multitypes-12.c -flto: error executing dg-final: 
> bad index "18-1": must be integer or end?-integer?
> 

The error message comes from Tcl but I don't know what it's complaining
about and it works fine for me, even if I replace "sparc*-*-*" with
"arm*-*-*".

Would you mind playing around with it a bit, like removing the xfail from
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target sparc*-*-* xfail ilp32 } } } */
and removing/disabling the directives with sparc*-*-*?

I had forgotten to move the comment above the replaced convoluted
directive: "/* bleah */".  I see it's still appropriate.

Janis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: testsuite] clean up convoluted dg-final directive in vect-multitypes-12.c
  2013-01-23 23:36   ` Janis Johnson
@ 2013-01-24  0:58     ` Eric Botcazou
  2013-01-24  1:02       ` Janis Johnson
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Botcazou @ 2013-01-24  0:58 UTC (permalink / raw)
  To: janisjo; +Cc: gcc-patches

> Would you mind playing around with it a bit, like removing the xfail from
> /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target
> sparc*-*-* xfail ilp32 } } } */ and removing/disabling the directives with
> sparc*-*-*?

I already played a bit when I wrote the original directive and didn't find any 
other way to do it (but my DejaGNU is admittedly quite limited).

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: testsuite] clean up convoluted dg-final directive in vect-multitypes-12.c
  2013-01-24  0:58     ` Eric Botcazou
@ 2013-01-24  1:02       ` Janis Johnson
  0 siblings, 0 replies; 7+ messages in thread
From: Janis Johnson @ 2013-01-24  1:02 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: janisjo, gcc-patches

On 01/23/2013 04:57 PM, Eric Botcazou wrote:
>> Would you mind playing around with it a bit, like removing the xfail from
>> /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target
>> sparc*-*-* xfail ilp32 } } } */ and removing/disabling the directives with
>> sparc*-*-*?
> 
> I already played a bit when I wrote the original directive and didn't find any 
> other way to do it (but my DejaGNU is admittedly quite limited).
> 

The ability to use both "target" and "xfail" in the same directive is fairly
new, but I haven't had any problems while playing around with it.  I don't
think it's used much in the test suite yet.  It's possible it's part of the
new problem you're seeing, although I don't understand how.

I modified the test because I expected to make another change to the dg-final
directives but now I don't need those changes, so if we don't figure out how
to fix it I can just revert the patch.

Janis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: testsuite] clean up convoluted dg-final directive in vect-multitypes-12.c
  2013-01-23 22:53 ` Eric Botcazou
  2013-01-23 23:36   ` Janis Johnson
@ 2013-01-24  9:16   ` Andreas Schwab
  2013-01-30  8:28     ` Jakub Jelinek
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2013-01-24  9:16 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: janisjo, gcc-patches

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.

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"

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: testsuite] clean up convoluted dg-final directive in vect-multitypes-12.c
  2013-01-24  9:16   ` Andreas Schwab
@ 2013-01-30  8:28     ` Jakub Jelinek
  0 siblings, 0 replies; 7+ messages in thread
From: Jakub Jelinek @ 2013-01-30  8:28 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Eric Botcazou, janisjo, gcc-patches

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-01-30  8:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-18 17:02 testsuite] clean up convoluted dg-final directive in vect-multitypes-12.c Janis Johnson
2013-01-23 22:53 ` Eric Botcazou
2013-01-23 23:36   ` Janis Johnson
2013-01-24  0:58     ` Eric Botcazou
2013-01-24  1:02       ` Janis Johnson
2013-01-24  9:16   ` Andreas Schwab
2013-01-30  8:28     ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).