binutils-gdb/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
Ruslan Kabatsayev adf8243ba9 Make tests expect [ \t]+ pattern instead of \t for "info reg" command
This will allow to format output of "info reg" command as we wish,
without breaking the tests. In particular, it'll let us correctly align
raw and natural values of the registers using spaces instead of current
badly-working approach with tabs.

This change is forwards- and backwards-compatible, so that the amended
tests will work in the same way before and after reformatting patches
(unless the tests check formatting, of course, but I've not come across
any such tests).

Some tests already used this expected pattern, so they didn't
even have to be modified. Others are changed by this patch.

I've checked this on a i386 system, with no noticeable differences in
test results, so at least on i386 nothing seems to be broken by this.

gdb/testsuite/ChangeLog:

	* gdb.arch/powerpc-d128-regs.exp: Replace expected "\[\t\]*" from
	"info reg" with "\[ \t\]*".
	* gdb.arch/altivec-regs.exp: Replace expected "\t" from "info reg" with
	"\[ \t\]+".
	* gdb.arch/s390-multiarch.exp: Ditto.
	* gdb.base/pc-fp.exp: Ditto.
	* gdb.reverse/i386-precsave.exp: Ditto.
	* gdb.reverse/i386-reverse.exp: Ditto.
	* gdb.reverse/i387-env-reverse.exp: Ditto.
	* gdb.reverse/i387-stack-reverse.exp: Ditto.
2018-01-19 09:05:51 +03:00

71 lines
2.1 KiB
Plaintext

# This testcase is part of GDB, the GNU debugger.
# Copyright 2008-2018 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 3 of the License, or
# (at your option) any later version.
#
# 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, see <http://www.gnu.org/licenses/>.
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@gnu.org
# Testcase for ppc decimal128 pseudo-registers.
if ![istarget "powerpc64*-*"] then {
verbose "Skipping powerpc Decimal128 pseudo-registers testcase."
return
}
standard_testfile
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quiet debug}] != "" } {
untested "failed to compile"
return -1
}
# Start with a fresh gdb.
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
if { ![runto main] } then {
fail "run to main"
return
}
if [gdb_test "show arch" ".*currently powerpc:common.*" "checking for PPC arch"] {
return -1
}
gdb_test "next" ""
for {set i 0} {$i < 16} {incr i 1} {
gdb_test "set \$dl$i=d128" "" "set dl$i register"
gdb_test "print \$dl$i" "\\\$$decimal = 1\.2345678910" "print dl$i register as DFP"
gdb_test "info reg dl$i" \
"dl$i\[ \]*1\.2345678910\[ \t\]*\\(raw 0x2205800000000000000000049c5de09c\\)" \
"print dl$i register with the info reg command"
gdb_test "info reg f[expr 2*$i]" \
"f[expr 2*$i]\[ \]*8\.608957309287334e\-145\[ \t\]*\\(raw 0x2205800000000000\\)" \
"testing lower half of dl$i register"
gdb_test "info reg f[expr 2*$i+1]" \
"f[expr 2*$i+1]\[ \]*9\.7841140127686122e\-314\[ \t\]*\\(raw 0x000000049c5de09c\\)" \
"testing upper half of dl$i register"
}