This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Adjust dg-skip-if documentation


On Fri, 2010-02-26 at 15:17 -0500, Daniel Jacobowitz wrote:
> Janis, could you double-check this for me?
> 
> I tried to write a test today that should be skipped if two options
> are both present.  The documentation sounds like it's this:
> 
> /* { dg-skip-if "" { *-*-* } { "-march=armv4t" "-mthumb" } { "" } } */
> 
> But in fact it has to be this:
> 
> /* { dg-skip-if "" { *-*-* } { "-march=armv4t -mthumb" } { "" } } */
> 
> Each element of include-opts is treated as a list by DejaGNU's
> framework.exp:check_conditional_xfail (foreach j "$opt").  The former
> example matches either -march=armv4t or -mthumb, the latter matches
> both (in any order or with things between them).
> 
> Hmm, perhaps this would benefit from some examples.
> 

Like some of these?  I can add some of them to the documentation (or you
can!)

skip:

/* { dg-skip-if "" { *-*-* } { "-O2" } { "" } } */
/* { dg-skip-if "" { *-*-* } { "-O2" "-g" } { "" } } */
/* { dg-skip-if "" { *-*-* } { "-O2 -g" } { "" } } */
/* { dg-skip-if "" { *-*-* } { "-O2 -g" "-O3 -fpic" } { "" } } */
/* { dg-skip-if "" { *-*-* } { "-O2 -fpic" "-O3 -fpic" "-O2 -g" }
{ "" } } */
/* { dg-skip-if "" { *-*-* } { "-O2 -fpic" "-O3 -fpic" "-g" } { "" } }
*/
/* { dg-skip-if "" { *-*-* } { "*" } { "-O2 -fpic" } } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O3 -g" "-O2 -fpic" } } */


do not skip:

/* { dg-skip-if "" { *-*-* } { "-O2 -O3" "-fpic -g" } { "" } } */
/* { dg-skip-if "" { *-*-* } { "-O2 -fpic" "-O3 -g" } { "" } } */
/* { dg-skip-if "" { *-*-* } { "-O2 -fpic" "-O3 -fpic" "-O3 -g" }
{ "" } } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O2 -g" } } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-g" "-O2" } } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O3 -g" "-O2" } } */

Here's my attempt at the documentation change:

Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi	(revision 157102)
+++ gcc/doc/sourcebuild.texi	(working copy)
@@ -1021,15 +1021,22 @@
 @end itemize
 
 @item @{ dg-skip-if @var{comment} @{ @var{selector} @} @{ @var{include-opts} @} @{ @var{exclude-opts} @} @}
-Skip the test if the test system is included in @var{selector} and if
-each of the options in @var{include-opts} is in the set of options with
-which the test would be compiled and if none of the options in
-@var{exclude-opts} is in the set of options with which the test would be
-compiled.
+Arguments @var{include-opts} and @var{exclude-opts} are lists in which
+each element is a string of zero or more GCC options.
+Skip the test if all of the following conditions are met:
+@itemize @bullet
+@item the test system is included in @var{selector}
 
-Use @samp{"*"} for an empty @var{include-opts} list and @samp{""} for
-an empty @var{exclude-opts} list.
+@item for at least one of the option strings in @var{include-opts},
+every option from that string is in the set of options with which
+the test would be compiled; use @samp{"*"} for an @var{include-opts} list
+that matches any options
 
+@item for each of the option strings in @var{exclude-opts}, at least one
+option from that string is not in the set of options with which the test
+would be compiled; use @samp{""} for an empty @var{exclude-opts} list
+@end itemize
+
 @item  @{ dg-xfail-if @var{comment} @{ @var{selector} @} @{ @var{include-opts} @} @{ @var{exclude-opts} @} @}
 Expect the test to fail if the conditions (which are the same as for
 @code{dg-skip-if}) are met.  This does not affect the execute step.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]