-# Copyright 2003, 2004 Free Software Foundation, Inc.
+# Copyright 2003-2020 Free Software Foundation, Inc.
#
# 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Tests for Powerpc E500 register setting and fetching
-if $tracelevel then {
- strace $tracelevel
-}
-
#
# Test the use of registers, especially E500 registers, for Powerpc.
# This file uses e500-regs.c for input.
#
-set prms_id 0
-set bug_id 0
if ![istarget "powerpc-*eabispe"] then {
verbose "Skipping e500 register tests."
set binfile ${objdir}/${subdir}/${testfile}
set src1 ${srcdir}/${subdir}/${testfile}.c
-if { [gdb_compile ${src1} ${binfile} executable {debug additional_flags=-w}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+if { [gdb_compile ${src1} ${binfile} executable {debug nowarnings}] != "" } {
+ untested "failed to compile"
+ return -1
}
gdb_start
#
if ![runto_main] then {
- gdb_suppress_tests
+ fail "can't run to main"
+ return 0
}
# set all the registers integer portions to 1
#gdb_test "next" "" ""
-send_gdb "show endian\n"
-gdb_expect {
- -re "(The target endianness is set automatically .currently )(big|little)( endian.*)$gdb_prompt $" {
- pass "endianness"
- set endianness $expect_out(2,string)
- }
- -re ".*$gdb_prompt $" {
- fail "couldn't get endianness"
- }
- timeout { fail "(timeout) endianness" }
-}
+set endianness [get_endianness]
# And then read the E500 registers back, to see that
# a) the register write above worked, and
}
# Now redo the same tests, but using the print command.
-# Note: in LE case, the char array is printed WITHOUT the last character.
-# Gdb treats the terminating null char in the array like the terminating
-# null char in a string and doesn't print it. This is not a failure, but
-# the way gdb works.
if {$endianness == "big"} {
- set decimal_vector ".uint64 = 4294967297, v2_float = .1.*e-45, 1.*e-45., v2_int32 = .1, 1., v4_int16 = .0, 1, 0, 1., v8_int8 = ..000.000.000.001.000.000.000.001.."
+ set decimal_vector ".uint64 = 4294967297, v2_float = .1.*e-45, 1.*e-45., v2_int32 = .1, 1., v4_int16 = .0, 1, 0, 1., v8_int8 = .0, 0, 0, 1, 0, 0, 0, 1.."
} else {
- set decimal_vector ".uint64 = 4294967297, v2_float = .1.*e-45, 1.*e-45., v2_int32 = .1, 1., v4_int16 = .1, 0, 1, 0., v8_int8 = ..001.000.000.000.001.000.000.."
+ set decimal_vector ".uint64 = 4294967297, v2_float = .1.*e-45, 1.*e-45., v2_int32 = .1, 1., v4_int16 = .1, 0, 1, 0., v8_int8 = .1, 0, 0, 0, 1, 0, 0, 0.."
}
for {set i 0} {$i < 32} {incr i 1} {
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if ![runto_main] then {
- gdb_suppress_tests
+ fail "can't run to main"
+ return 0
}
gdb_test "break vector_fun" \
"Breakpoint 2 at.*e500-regs.c, line \[0-9\]+\\." \
- "Set breakpoint at vector_fun"
+ "set breakpoint at vector_fun"
# Actually it is nuch easier to see these results printed in hex.
# gdb_test "set output-radix 16" \
# "Output radix now set to decimal 16, hex 10, octal 20." \
-# "Set output radix to hex"
+# "set output radix to hex"
gdb_test "continue" \
"Breakpoint 2, vector_fun .a=.-2, -2., b=.1, 1.*e500-regs.c.*ev_create_s32 .2, 2.;" \