This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Clean up tests where a later dg-do completely overrides another.
- From: Dominik Vogt <vogt at linux dot vnet dot ibm dot com>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: gcc-patches at gcc dot gnu dot org, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Sat, 30 Apr 2016 00:56:06 +0100
- Subject: Re: [PATCH] Clean up tests where a later dg-do completely overrides another.
- Authentication-results: sourceware.org; auth=none
- References: <20160427075023 dot GA5082 at linux dot vnet dot ibm dot com> <ydd7ffgqj1f dot fsf at CeBiTec dot Uni-Bielefeld dot DE>
- Reply-to: vogt at linux dot vnet dot ibm dot com
On Fri, Apr 29, 2016 at 10:03:40PM +0200, Rainer Orth wrote:
> Dominik Vogt <vogt@linux.vnet.ibm.com> writes:
>
> > The attached patch cleans up some (mostly unnecessary) dg-do
> > directives in the gcc.dg and gcc.target test cases.
>
> This part
>
> * gcc.dg/spec-options.c: Switch order of the two "dg-do run" so that
> the test ist actually "run" on sh*-*-*. Order _does_ matter.
(We're talking about this diff)
>> -/* { dg-do run { target sh*-*-* } } */
>> /* { dg-do compile } */
>> +/* { dg-do run { target sh*-*-* } } */
> caused
>
> FAIL: gcc.dg/spec-options.c execution test
>
> (almost?) everywhere: on i386-pc-solaris2.12 and x86_64-pc-linux-gnu at
> least, the test was a compile test before and is now an execute test.
Yeah, sorry, I really should have mentioned this but forgot about
it. It's a bug in DejaGnu. When it encounters a conditional
dg-do and the condition does not match, it *still* replaces the
do-action of a prior dg-do with the current one. With DejaGnu
prior to 1.6, there are two possibilities.
/* { dg-do run { target sh*-*-* } } */
/* { dg-do compile } */
The "compile" always wins. The test is just compiled on all
platforms and not run anywhere. With
/* { dg-do compile } */
/* { dg-do run { target sh*-*-* } } */
The "run" wins and the test is compiled and run everywhere, even
on targets that do not match sh*-*-*.
The bug is fixed in DejaGnu-1.6 which has been released on the
15th of April. This is the fix:
http://git.savannah.gnu.org/gitweb/?p=dejagnu.git;a=commit;h=569f8718b534a2cd9511a7d640352eb0126ff492
(The patch could easily be backported to earlier DejaGnu
releases.)
I think it might be best to either update DejaGnu locally or to
live with the failure. It really indicates a bug - in DejaGnu
though, not in Gcc. However, there are some target specific test
cases that rely on multiple conditional dg-do to work properly
that are not executed as they should be (some stuff on Power and
another target that I can't remember; Mips?). The only way to
deal with the situation properly is to upgrade DejaGnu. Otherwise
you either have failing test cases or test cases don't do what the
test file says.
Maybe a comment should be added to the test case
/* If this test is *run* (not just compiled) and therefore fails
on non sh*-targets, this is because of a bug older DejaGnu
versions. This is fixed with DejaGnu-1.6. */
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
IBM Germany