[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple dg-do do not work.
From: |
Dominik Vogt |
Subject: |
Re: Multiple dg-do do not work. |
Date: |
Wed, 9 Mar 2016 13:55:55 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Mar 09, 2016 at 11:18:28AM +1100, Ben Elliston wrote:
> On Tue, Mar 08, 2016 at 02:29:10PM +0100, Dominik Vogt wrote:
>
> > However, multiple dg-do don't seem to work:
> >
> > dg-do run { condition }
> > dg-do assemble { ! condition }
>
> There are plenty of examples of this in the testsuite. You may wish to
> investigate further:
>
> $ grep -r dg-do . | awk -F: '{print $1}' | uniq -d
>
> For example, the top of gcc.target/powerpc/altivec-3.c says:
>
> /* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
> /* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
>
> So compile awyas on powerpc-*-*, but only run if the taget has the
> right hardware. It should certainly work. If it doesn't, please send
> a patch!
The problem is really that if a condition deselects a test
(dg-process-target returns 'N'), and an earlier dg-do already
selected the test, the first word of $dg-what still gets replaced
by the new (deselected) action. E.g.
* $dg-what is "compile {} P" at first (default value)
* becomes "run S P" after evaluating the selected "dg-do run"
* becomes "assemble S P" after ervaluating deselected "dg-do" assemble.
The attached patch fixes the problem for me by not changing the
action if a deselected dg-do is encountered. Note that my
knowledge of Tcl is about zero, so there may be any number of bugs
in that patch.
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
IBM Germany
dg.exp.patch
Description: Text Data