]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.arch/e500-abi.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / e500-abi.exp
CommitLineData
1d506c26 1# Copyright 2003-2024 Free Software Foundation, Inc.
bf6bad4b
AC
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
bf6bad4b
AC
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
bf6bad4b 15#
bf6bad4b
AC
16
17# Tests for Powerpc e500 ABI
18
19
bf6bad4b
AC
20#
21# This file uses e500-abi.c for input.
22#
23
73c06197 24require {istarget "powerpc-*eabispe"}
bf6bad4b
AC
25
26set testfile "e500-abi"
27set binfile ${objdir}/${subdir}/${testfile}
28
29set src1 ${srcdir}/${subdir}/${testfile}.c
30
fc91c6c2 31if { [gdb_compile ${src1} ${binfile} executable {debug nowarnings}] != "" } {
5b362f04 32 untested "failed to compile"
b60f0898 33 return -1
bf6bad4b
AC
34}
35
36gdb_start
37gdb_reinitialize_dir $srcdir/$subdir
38gdb_load ${binfile}
39
40#
41# Run to `main' where we begin our tests.
42#
43
75b6f386 44if {![runto_main]} {
c8ee3f04 45 return 0
bf6bad4b
AC
46}
47
48gdb_test "b marker" "Breakpoint 2 at.*file.*e500-abi.c, line \[0-9\]+." "break marker"
49gdb_test "continue" "Breakpoint 2.*marker.*e500-abi.c.*" "continue to marker"
50gdb_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)"
51
52# now all the arguments of vec_func are initialized
53
54set 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.."
55
56set pattern1 $pattern
57append pattern1 " at.*e500-abi.c.*x = 2;"
58
59# Now let's call the function. This function has > 8 args,
60# the last ones will go on the stack.
61gdb_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)" \
62".\[0-9\]+ = .6, 63." "call inferior function with vectors (1) "
63
64# Let's call the function again with dummy arguments. This is to clean
65# up the contents of the ev registers before the next call.
66gdb_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)" \
67".\[0-9\]+ = .1, 1." "call inferior function with vectors (2) "
68
69# Let's step into the function, to see if the args are printed correctly.
70gdb_test "step" \
71 $pattern1 \
72 "step into vec_func"
73
74# Let's see if the result is returned correctly.
75gdb_test "finish" \
76 "Run till exit from .0.* at.*e500-abi.c.*main.*res_vec = vec_func .a_vec,.*goes in r3.*Value returned is.*= .6, 63." \
77 "vector value returned correctly"