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

login
register
mail settings
Submitter Janis Johnson
Date Jan. 18, 2013, 5:05 p.m.
Message ID <50F980CE.6030609@mentor.com>
Download mbox | patch
Permalink /patch/213680/
State New
Headers show

Comments

Janis Johnson - Jan. 18, 2013, 5:05 p.m.
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
2013-01-18  Janis Johnson  <janisjo@codesourcery.com>

	* gcc.dg/vect/vect-multitypes-12.c: Refactor dg-final directive.
Eric Botcazou - Jan. 23, 2013, 10:52 p.m.
> 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?
Janis Johnson - Jan. 23, 2013, 11:39 p.m.
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
Eric Botcazou - Jan. 24, 2013, 12:57 a.m.
> 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).
Janis Johnson - Jan. 24, 2013, 1:06 a.m.
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

Patch

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" } } */