[_Complex test 1/4] support_complex_tests in gdb.exp and pass _Complex args to func

Yao Qi yao@codesourcery.com
Fri May 20 08:10:00 GMT 2011


On 05/20/2011 01:09 AM, Tom Tromey wrote:
>>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
> 
> Yao> +#ifdef PROTOTYPES
> Yao> +void callca (float _Complex f1, float _Complex f2, float _Complex f3)
> Yao> +#else
> Yao> +callca (f1, f2, f3)
> Yao> +float _Complex f1; float _Complex f2; float _Complex f3;
> Yao> +#endif
> 
> I would not worry about the no PROTOTYPES case.  You can leave this in
> if you want though.
> 

OK, I'll leave them there.

> Yao> +set compile_flags {debug nowarnings quiet}
> Yao> +if [support_complex_tests] {
> Yao> +    set compile_flags "$compile_flags additional_flags=-DTEST_COMPLEX"
> 
> I think it is better to use lappend here.
> 

Done.

> Yao> +    gdb_breakpoint callca;
> Yao> +    gdb_breakpoint callcb;
> Yao> +    gdb_breakpoint callcc;
> Yao> +    gdb_breakpoint callcd;
> Yao> +    gdb_breakpoint callce;
> Yao> +    gdb_breakpoint callcf;
> 
> These ";"s are not needed.  There are a few instances of this.
> 

Fixed.

> Yao> +# Return a 1 if we should run tests to _Complex types, otherwise, skip it.
> 
> Just "Return 1 if...", and then ", otherwise 0.".
> 

Fixed.

> I am curious if you tested this in some situation where the complex
> tests are skipped.

I simulate the `complex-unsupported platform' by removing "o" in keyword
"double" in support_complex_tests, "_Complex double cd;" -> "_Complex
duble cd;", and run gdb.base/varargs.exp again.  As you can see,
_Complex related tests are skipped.

Running ../../../git/gdb/gdb/testsuite/gdb.base/varargs.exp ...

		=== gdb Summary ===

# of expected passes		8

-- 
Yao (齐尧)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-funcargs.patch
Type: text/x-patch
Size: 10458 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20110520/55faefe3/attachment.bin>


More information about the Gdb-patches mailing list