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: [PATCH] PPC Call-clobbered registers testcase


Thanks for doing this.

On Tue, Sep 25, 2007 at 10:21:51AM -0300, Luis Machado wrote:
> 2007-09-24  Luis Machado  <luisgpm@br.ibm.com>
> 
>     * ppc-clobbered-registers-O2.c: New testcase source file.
>     * ppc-clobbered-registers-O2.exp: New testcase expect file.

The directory name should be included here.  Also, gdb.trace doesn't
mean what you think it does :-)  It's for tracepoint tests; so instead
you probably want gdb.base.

Alternatively, a new gdb.opt for optimized code tests.  CodeSourcery
has a project I hope we will be contributing by the beginning of next
year that puts a few testcases in gdb.opt; if no one thinks that's a
bad idea, then let's start the directory now.

There's nothing PowerPC specific about these tests.  So I would
recommend not putting ppc in their names or skipping them for
non-PowerPC targets.  It will turn up the same bug on other platforms
that passed arguments in registers, hopefully.

> Index: gdb/testsuite/gdb.trace/ppc-clobbered-registers-O2.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ gdb/testsuite/gdb.trace/ppc-clobbered-registers-O2.c	2007-09-24 07:26:39.000000000 -0700
> @@ -0,0 +1,21 @@
> +
> +unsigned * __attribute__((noinline))

New test cases should have a copyright header, please.  And let's use

#ifndef __GNUC__
#define __attribute__(x)
#endif

so that non-GNU compilers can have a chance to run the test too.  At
least in theory.

> +set compile_flags "debug additional_flags=-O2"

"debug optimize=-O2"

> +gdb_test backtrace ".*operand0=<value optimized out>.*operand1=<value optimized out>.*" \
> +  "Check value of call clobbered registers"

May as well let the test pass if it sees the correct values, too.

-- 
Daniel Jacobowitz
CodeSourcery


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