This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfc] add ppc testcase to test fpscr


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]