This is the mail archive of the gdb-patches@sources.redhat.com 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] test for altivec h/w on PowerPC


On Wed, Mar 02, 2005 at 01:46:35PM -0800, Paul Gilliam wrote:
> +2004-03-01  Paul Gilliam  <pgilliam@us.ibm.com>
> +
> +        * lib/gdb.exp: added 'skip_altivec_tests', a modification of
> +        Janis Johnson's 'check_vmx_hw_available' from GCC testsuite
> +        * lib/gdb.arch/altivec-abi.exp: use new 'skip_altivec_tests'
> +        * lib/gdb.arch/altivec-regs.exp: Likewise
> +

First, please don't include changelogs as diffs.  And be careful of
tabs.

Secondly, this should be:
	* lib/gdb.exp (skip_altivec_tests): New function, based on
	check_vmx_hw_available from the GCC testsuite.
	* lib/gdb.arch/altivec-abi.exp: Use skip_altivec_tests.
	* lib/gdb.arch/altivec-regs.exp: Likewise.

Caps, final periods.

>  2004-02-24  Joel Brobecker  <brobecker@adacore.com>
>  
>  	* gdb.ada/fixed_points.exp: Create compilation object directory
> diff -Naur testsuite.old/gdb.arch/altivec-abi.exp testsuite/gdb.arch/altivec-abi.exp
> --- testsuite.old/gdb.arch/altivec-abi.exp	2005-03-01 14:56:21.484222560 -0800
> +++ testsuite/gdb.arch/altivec-abi.exp	2005-03-01 15:01:49.451289288 -0800
> @@ -32,7 +32,7 @@
>  set prms_id 0
>  set bug_id 0
>  
> -if ![istarget "powerpc-*altivec"] then {
> +if [skip_altivec_tests] {

How about ![istarget "powerpc*-*-*"] || [skip_altivec_tests]?  No point
compiling the test on i386!

> +    # Some simulators are known to not support VMX instructions.
> +    if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] } {
> +        verbose "check_hw_available  returning 0" 2

Please either update the error message, or leave the function named
check_vmx_hw_available :-)

> +    verbose "skip_altivec_testing  compiling testfile $src" 1
> +    set lines [gdb_compile $src $exe executable {debug additional_flags=-maltivec}]
> +    file delete $src

This is a GCC-only option.  Will the tests ever be useful with a
non-GCC compiler?  If not, please make them fail gracefully before they
try to invoke another compiler with -maltivec.  See test_compiler_info.

> +
> +    if ![string match "" $lines] then {
> +        verbose "check_vmx_hw_availalble testfile compilation failed" 2
> +        return [set skip_vmx_tests_saved 1]
> +    }
> +
> +    # No error message, compilation succeeded so now run it.
> +
> +    set exec_result [remote_exec target "./$exe"]
> +    remote_file build delete "$exe"

You just compiled a binary on the build machine and tried to use
remote_exec on a target... you're probably not in the same current
directory.  Have you tried just doing it the same way the GCC testsuite
does, using ${tool}_load?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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