On Fri, Oct 07, 2005 at 12:06:32PM -0700, Kean Johnston wrote: > >You're in luck! dg-warning and similar directives can be skipped or > >xfailed for particular targets, but those don't take options into > >account. There is, however, an effective-target keyword for fpic. > Ok I'll give that a whirl. But what if I needed to skip the test > based on some other command line option? Intuitively, I would want > to use dg-skip-if or dg-xfail-if, which provide a more generalized > approach to command line checking and doesnt rely on that special > target.
Sorry, that's not supported. > >The directives used in the GCC testsuite, along with effective-target > >keywords and target/xfail selectors, are documented at > >http://gcc.gnu.org/onlinedocs/gccint/Test-Directives.html. > > I read that carefully before asking the question, and it is very > unclear (to me, a non-DG head) what the scope of some of those > directives are. For example, dh-skip-if seems to apply to the > entire test case, whereas things line dg-warning can appear on > a line-by-line basis. Or perhaps I'm just assuming that, and they > can in fact be used on a line-by-line test basis. What would make it more clear? I could add a paragraph before the list of directives saying that dg-error, dg-warning, and dg-bogus apply to a single line and that others apply to the entire test, or could list them separately, preceded by text that they apply to a single line. This stuff is confusing and it would be nice for the documentation to make it less so. > This is purely for my education's sake (the fpic target you > mentioned will suffice for the specific case I care about), but > if I wanted to, say xfail the test if -mfoo was specified on the > command line: Could I have something like: > > foo(); /* dg-warning "regexp" { ! dg-skip-if { "" { i?86-*-* } { "-mfoo" > } { "" } } */ > > The tcl syntax makes my head hurt so if thats wrong and you can > show me a generalized way to do this type of thing I would be > very grateful. Thank you Janis! No, there's no way to do that. It took lots of fighting with TCL and DejaGnu (and a tiny recursive-descent parser in TCL!) to get the target/xfail selectors to work, and it would be difficult to support the option lists for dg-warning and friends since those are defined within DejaGnu. If there's enough demand for it, though, anything is possible. Janis