public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [Patch, test] Enable to prune warnings for tests defined in one exp file
@ 2012-10-10  8:12 Eric Botcazou
  2012-10-10  8:25 ` Terry Guo
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Botcazou @ 2012-10-10  8:12 UTC (permalink / raw)
  To: Terry Guo; +Cc: gcc-patches, Richard Guenther

> 2012-08-27  Terry Guo  <terry.guo@arm.com>
> 
>         * lib/gcc-dg.exp (dg_runtest_extra_prunes): New variable to define
> rules
>         that will be applied to all tests in a .exp file.
>         (gcc-dg-prune): Include rules defined by the above variable.
> 
>         * gcc.target/arm/arm.exp (dg_runtest_extra_prunes): Skip all the
> harmless
>         architecture switch conflict warnings.

Why does this appear in the gcc/ChangeLog on the 4.7 branch?

-- 
Eric Botcazou

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

* RE: [Patch, test] Enable to prune warnings for tests defined in one exp file
  2012-10-10  8:12 [Patch, test] Enable to prune warnings for tests defined in one exp file Eric Botcazou
@ 2012-10-10  8:25 ` Terry Guo
  0 siblings, 0 replies; 5+ messages in thread
From: Terry Guo @ 2012-10-10  8:25 UTC (permalink / raw)
  To: 'Eric Botcazou'; +Cc: gcc-patches



> -----Original Message-----
> From: Eric Botcazou [mailto:ebotcazou@adacore.com]
> Sent: Wednesday, October 10, 2012 3:56 PM
> To: Terry Guo
> Cc: gcc-patches@gcc.gnu.org; Richard Guenther
> Subject: Re: [Patch, test] Enable to prune warnings for tests defined
> in one exp file
> 
> > 2012-08-27  Terry Guo  <terry.guo@arm.com>
> >
> >         * lib/gcc-dg.exp (dg_runtest_extra_prunes): New variable to
> > define rules
> >         that will be applied to all tests in a .exp file.
> >         (gcc-dg-prune): Include rules defined by the above variable.
> >
> >         * gcc.target/arm/arm.exp (dg_runtest_extra_prunes): Skip all
> > the harmless
> >         architecture switch conflict warnings.
> 
> Why does this appear in the gcc/ChangeLog on the 4.7 branch?
> 
> --
> Eric Botcazou
> 

Thanks Eric for reminding and very sorry for my mistake. I am correcting it.

BR,
Terry


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

* RE: [Patch, test] Enable to prune warnings for tests defined in one exp file
  2012-08-27 17:21 ` Mike Stump
@ 2012-08-30  2:43   ` Terry Guo
  0 siblings, 0 replies; 5+ messages in thread
From: Terry Guo @ 2012-08-30  2:43 UTC (permalink / raw)
  To: 'Mike Stump'; +Cc: gcc-patches, Richard Guenther

> -----Original Message-----
> From: Mike Stump [mailto:mikestump@comcast.net]
> Sent: Tuesday, August 28, 2012 1:21 AM
> To: Terry Guo
> Cc: gcc-patches@gcc.gnu.org; Richard Guenther
> Subject: Re: [Patch, test] Enable to prune warnings for tests defined
> in one exp file
> 
> On Aug 27, 2012, at 1:14 AM, Terry Guo wrote:
> > This patch intends to provide a chance to prune common warning
> messages for
> > tests defined in an exp file.
> 
> > Is it OK to trunk?
> 
> Ok.
> 
> If you can find where to document this...  :-)  That'd be nice.
> 

I checked the texi files in gcc/doc folder, but can't find a suitable place.
So I resort to README.gcc in gcc/testsuite which is claimed to list notes
for those writing testcases and those writing expect scripts. Following is
the patch. Is it OK?

BR,
Terry

2012-08-30  Terry Guo  <terry.guo@arm.com>

        * README.gcc: Document new variable dg_runtest_extra_prunes.

Index: gcc/testsuite/README.gcc
===================================================================
--- gcc/testsuite/README.gcc	(revision 190795)
+++ gcc/testsuite/README.gcc	(working copy)
@@ -79,6 +79,11 @@
 
 If a test does not fit into the torture framework, use the dg framework.
 
+If some tests in an exp file need to skip same warning messages, just
define
+variable dg_runtest_extra_prunes in this exp file and let it contain this
warning
+message pattern.  This can avoid duplicating dg-prune in these cases.
+Always remember to clear this variable when leave this exp file.
+
 

 Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.


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

* Re: [Patch, test] Enable to prune warnings for tests defined in one exp file
  2012-08-27  8:13 Terry Guo
@ 2012-08-27 17:21 ` Mike Stump
  2012-08-30  2:43   ` Terry Guo
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Stump @ 2012-08-27 17:21 UTC (permalink / raw)
  To: Terry Guo; +Cc: gcc-patches, Richard Guenther

On Aug 27, 2012, at 1:14 AM, Terry Guo wrote:
> This patch intends to provide a chance to prune common warning messages for
> tests defined in an exp file.

> Is it OK to trunk?

Ok.

If you can find where to document this...  :-)  That'd be nice.

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

* [Patch, test] Enable to prune warnings for tests defined in one exp file
@ 2012-08-27  8:13 Terry Guo
  2012-08-27 17:21 ` Mike Stump
  0 siblings, 1 reply; 5+ messages in thread
From: Terry Guo @ 2012-08-27  8:13 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Guenther

Hello,

This patch intends to provide a chance to prune common warning messages for
tests defined in an exp file. It can avoid adding dg-prune to such cases one
by one. The story behind this patch is that when torture cases in arm.exp
with various arch/cpu options, there are always warnings on "warning: switch
-mcpu=cortex-m3 conflicts with -march=armv5te switch [enabled by default]".
The "-march=armv5te" is from dg-options of the case. The "-mcpu=cortex-m3"
is from options we used to torture this case. To avoid such harmless
warnings, usually we need to manually add dg-prune to such cases one by one.
This is kind of less efficient. With this path, we just need to add this
warning into variable dg_runtest_extra_prunes.

The related discussion is at
http://gcc.gnu.org/ml/gcc-patches/2011-09/msg00630.html.

Tested on QEMU for cortex-m3 and x86 platform. The test-framework.exp is
also enabled. No regression found.

Is it OK to trunk?

BR,
Terry

2012-08-27  Terry Guo  <terry.guo@arm.com>

        * lib/gcc-dg.exp (dg_runtest_extra_prunes): New variable to define
rules
        that will be applied to all tests in a .exp file.
        (gcc-dg-prune): Include rules defined by the above variable.

        * gcc.target/arm/arm.exp (dg_runtest_extra_prunes): Skip all the
harmless
        architecture switch conflict warnings.

diff --git a/gcc/testsuite/gcc.target/arm/arm.exp
b/gcc/testsuite/gcc.target/arm/arm.exp
index 0838d37..3a62b24 100644
--- a/gcc/testsuite/gcc.target/arm/arm.exp
+++ b/gcc/testsuite/gcc.target/arm/arm.exp
@@ -30,6 +30,11 @@ if ![info exists DEFAULT_CFLAGS] then {
     set DEFAULT_CFLAGS " -ansi -pedantic-errors"
 }

+# This variable should only apply to tests called in this exp file.
+global dg_runtest_extra_prunes
+set dg_runtest_extra_prunes ""
+lappend dg_runtest_extra_prunes "warning: switch -m(cpu|arch)=.* conflicts
with -m(cpu|arch)=.* switch"
+
 # Initialize `dg'.
 dg-init

@@ -38,4 +43,5 @@ dg-runtest [lsort [glob -nocomplain
$srcdir/$subdir/*.\[cCS\]]] \
        "" $DEFAULT_CFLAGS

 # All done.
+set dg_runtest_extra_prunes ""
 dg-finish
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 3bff8b4..825c2f6 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -211,9 +211,13 @@ proc gcc-dg-test { prog do_what extra_tool_flags } {
 proc gcc-dg-prune { system text } {
     global additional_prunes

+    # Extra prune rules that will apply to tests defined in a .exp file.
+    # Always remember to clear it in .exp file after executed all tests.
+    global dg_runtest_extra_prunes
+
     set text [prune_gcc_output $text]

-    foreach p $additional_prunes {
+    foreach p "$additional_prunes $dg_runtest_extra_prunes" {
        if { [string length $p] > 0 } {
            # Following regexp matches a complete line containing $p.
            regsub -all "(^|\n)\[^\n\]*$p\[^\n\]*" $text "" text
@@ -809,3 +813,4 @@ proc gdb-exists { args } {
 }

 set additional_prunes ""
+set dg_runtest_extra_prunes ""


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

end of thread, other threads:[~2012-10-10  8:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-10  8:12 [Patch, test] Enable to prune warnings for tests defined in one exp file Eric Botcazou
2012-10-10  8:25 ` Terry Guo
  -- strict thread matches above, loose matches on Subject: below --
2012-08-27  8:13 Terry Guo
2012-08-27 17:21 ` Mike Stump
2012-08-30  2:43   ` Terry Guo

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).