This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Questions about the dg-do directive
- From: Janis Johnson <janis_johnson at mentor dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Dominique Dhumieres <dominiq at lps dot ens dot fr>, <gcc at gcc dot gnu dot org>, <mikestump at comcast dot net>, <ro at CeBiTec dot Uni-Bielefeld dot DE>, <janisjo at codesourcery dot com>
- Date: Tue, 16 Oct 2012 08:34:57 -0700
- Subject: Re: Questions about the dg-do directive
- References: <20121016132011.F157F3BE1C@mailhost.lps.ens.fr> <m2vceay05q.fsf@igel.home>
- Reply-to: <janisjo at codesourcery dot com>
On 10/16/2012 07:14 AM, Andreas Schwab wrote:
> dominiq@lps.ens.fr (Dominique Dhumieres) writes:
>
>> These questions are motivated by the comments #4 to #15 of pr54407.
>>
>> The bottom line is that
>>
>> { dg-do compile targets1 }
>> { dg-do run targets2 }
>>
>> behaves as
>>
>> {dg-do run { targets1 targets2 } }
>>
>> while
>>
>> { dg-do run targets1 }
>> { dg-do compile targets2 }
>>
>> as
>>
>> { dg-do compile { targets1 targets2 } }
>>
>> (1) Is the above correct?
>> (2) If yes, is it a (undocumented) feature or a bug?
That's just the way it works, so I suppose you could call it a feature.
DejaGnu doesn't support having different dg-do-what values for different
targets within a test, although it can be done from outside the test in
the .exp file. Tests that try to do that are broken.
> From dg.exp:
>
> # Multiple instances are supported (since we don't support target and xfail
> # selectors on one line), though it doesn't make much sense to change the
> # compile/assemble/link/run field. Nor does it make any sense to have
> # multiple lines of target selectors (use one line).
>
> Andreas.
I wouldn't rely on that feature, either. We have much better ways in
local test directives to skip and xfail tests for different targets.
Janis