OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.arch/] [e500-abi.exp] - Diff between revs 24 and 157

Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 157
# Copyright 2003, 2007, 2008 Free Software Foundation, Inc.
# Copyright 2003, 2007, 2008 Free Software Foundation, Inc.
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .
# along with this program.  If not, see .
#
#
# Please email any bugs, comments, and/or additions to this file to:
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# bug-gdb@prep.ai.mit.edu
#
#
# Tests for Powerpc e500 ABI
# Tests for Powerpc e500 ABI
if $tracelevel then {
if $tracelevel then {
    strace $tracelevel
    strace $tracelevel
}
}
#
#
# This file uses e500-abi.c for input.
# This file uses e500-abi.c for input.
#
#
set prms_id 0
set prms_id 0
set bug_id 0
set bug_id 0
if ![istarget "powerpc-*eabispe"] then {
if ![istarget "powerpc-*eabispe"] then {
    verbose "Skipping e500 abi tests."
    verbose "Skipping e500 abi tests."
    return
    return
}
}
set testfile "e500-abi"
set testfile "e500-abi"
set binfile ${objdir}/${subdir}/${testfile}
set binfile ${objdir}/${subdir}/${testfile}
set src1 ${srcdir}/${subdir}/${testfile}.c
set src1 ${srcdir}/${subdir}/${testfile}.c
if  { [gdb_compile ${src1} ${binfile} executable {debug nowarnings}] != "" } {
if  { [gdb_compile ${src1} ${binfile} executable {debug nowarnings}] != "" } {
     untested e500-abi.exp
     untested e500-abi.exp
     return -1
     return -1
}
}
gdb_start
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_load ${binfile}
#
#
# Run to `main' where we begin our tests.
# Run to `main' where we begin our tests.
#
#
if ![runto_main] then {
if ![runto_main] then {
    gdb_suppress_tests
    gdb_suppress_tests
}
}
gdb_test "b marker" "Breakpoint 2 at.*file.*e500-abi.c, line \[0-9\]+." "break marker"
gdb_test "b marker" "Breakpoint 2 at.*file.*e500-abi.c, line \[0-9\]+." "break marker"
gdb_test "continue" "Breakpoint 2.*marker.*e500-abi.c.*" "continue to marker"
gdb_test "continue" "Breakpoint 2.*marker.*e500-abi.c.*" "continue to marker"
gdb_test "finish" "Run till exit from .0.*marker.*at.*e500-abi.c.*main \\(\\) at.*e500-abi.c.*res_vec = vec_func \\(a_vec,.*goes in r3.*" "back to main (1)"
gdb_test "finish" "Run till exit from .0.*marker.*at.*e500-abi.c.*main \\(\\) at.*e500-abi.c.*res_vec = vec_func \\(a_vec,.*goes in r3.*" "back to main (1)"
# now all the arguments of vec_func are initialized
# now all the arguments of vec_func are initialized
set pattern "vec_func .a_vec_f=.0, 55., b_vec_f=.0, 66., c_vec_f=.3.14.*2.18.*, d_vec_f=.5, 4., e_vec_f=.5, 6., f_vec_f=.6, 6, 7, 1., g_vec_f=.6, 6, 7, 9., h_vec_f=.3, 2., i_vec_f=.3, 2., l_vec_f=.3, 5., m_vec_f=.6, 9.."
set pattern "vec_func .a_vec_f=.0, 55., b_vec_f=.0, 66., c_vec_f=.3.14.*2.18.*, d_vec_f=.5, 4., e_vec_f=.5, 6., f_vec_f=.6, 6, 7, 1., g_vec_f=.6, 6, 7, 9., h_vec_f=.3, 2., i_vec_f=.3, 2., l_vec_f=.3, 5., m_vec_f=.6, 9.."
set pattern1 $pattern
set pattern1 $pattern
append pattern1 " at.*e500-abi.c.*x = 2;"
append pattern1 " at.*e500-abi.c.*x = 2;"
# Now let's call the function.  This function has > 8 args,
# Now let's call the function.  This function has > 8 args,
# the last ones will go on the stack.
# the last ones will go on the stack.
gdb_test "p vec_func(a_vec,b_vec,c_vec,d_vec,e_vec,f_vec,g_vec,h_vec,i_vec,l_vec,m_vec)" \
gdb_test "p vec_func(a_vec,b_vec,c_vec,d_vec,e_vec,f_vec,g_vec,h_vec,i_vec,l_vec,m_vec)" \
".\[0-9\]+ = .6, 63." "call inferior function with vectors (1) "
".\[0-9\]+ = .6, 63." "call inferior function with vectors (1) "
# Let's call the function again with dummy arguments.  This is to clean
# Let's call the function again with dummy arguments.  This is to clean
# up the contents of the ev registers before the next call.
# up the contents of the ev registers before the next call.
gdb_test "p vec_func(a_vec_d,b_vec_d,c_vec_d,d_vec_d,e_vec_d,f_vec_d,g_vec_d,h_vec_d,i_vec_d,l_vec_d,m_vec_d)" \
gdb_test "p vec_func(a_vec_d,b_vec_d,c_vec_d,d_vec_d,e_vec_d,f_vec_d,g_vec_d,h_vec_d,i_vec_d,l_vec_d,m_vec_d)" \
".\[0-9\]+ = .1, 1." "call inferior function with vectors (2) "
".\[0-9\]+ = .1, 1." "call inferior function with vectors (2) "
# Let's step into the function, to see if the args are printed correctly.
# Let's step into the function, to see if the args are printed correctly.
gdb_test "step" \
gdb_test "step" \
  $pattern1 \
  $pattern1 \
  "step into vec_func"
  "step into vec_func"
# Let's see if the result is returned correctly.
# Let's see if the result is returned correctly.
gdb_test "finish" \
gdb_test "finish" \
  "Run till exit from .0.* at.*e500-abi.c.*main.*res_vec = vec_func .a_vec,.*goes in r3.*Value returned is.*= .6, 63." \
  "Run till exit from .0.* at.*e500-abi.c.*main.*res_vec = vec_func .a_vec,.*goes in r3.*Value returned is.*= .6, 63." \
  "vector value returned correctly"
  "vector value returned correctly"
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.