This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] add ppc testcase to test fpscr
- From: Daniel Jacobowitz <drow at false dot org>
- To: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- Cc: Joel Brobecker <brobecker at adacore dot com>, gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Tue, 2 Sep 2008 19:45:54 -0400
- Subject: Re: [rfc] add ppc testcase to test fpscr
- References: <1219360611.8989.6.camel@localhost.localdomain> <20080821233115.GA1239@caradoc.them.org> <1219362081.29526.2.camel@localhost.localdomain> <20080822024659.GA12951@caradoc.them.org> <1219428669.8167.2.camel@localhost.localdomain> <20080902213949.GH3774@adacore.com> <1220398310.4204.22.camel@localhost.localdomain>
On Tue, Sep 02, 2008 at 08:31:50PM -0300, Thiago Jung Bauermann wrote:
> > Looks OK to me, but I'm really wonderng why you added a '\r' at
> > the end of the expected output in our gdb_test calls.
>
> That was the closest I could think of to an EOL marker. Using '$' is not
> an option, I believe.
You don't need an EOL marker; gdb_test adds \r\n after the supplied
pattern.
> > > +#include <stdio.h>
> >
> > Is the use of stdio necessary in this case. If you can do without,
> > then this would allow us to run this testcase in the bareboard case
> > (powerpc-elf). Not strictly necessary, but nice to have...
>
> I added the printf calls just to make sure GCC doesn't make the 'result'
> variable vanish. Maybe that's not necessary, since the asm blocks
> mention result as an output variable? Or maybe GCC would also nuke the
> asm blocks instead, seeing that they serve no useful purpose if 'result'
> is also not used? I don't know.
GCC won't eliminate user variables at -O0. If you want the test to
work with optimization, or with non-GCC compilers, try making result a
volatile global.
--
Daniel Jacobowitz
CodeSourcery