]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
Update copyright year range in all GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / powerpc-d128-regs.exp
CommitLineData
5e1a1926
TJB
1# This testcase is part of GDB, the GNU debugger.
2
42a4f53d 3# Copyright 2008-2019 Free Software Foundation, Inc.
5e1a1926
TJB
4
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18# Please email any bugs, comments, and/or additions to this file to:
19# bug-gdb@gnu.org
20
21# Testcase for ppc decimal128 pseudo-registers.
22
0ff3e01f 23if ![istarget "powerpc64*-*"] then {
5e1a1926
TJB
24 verbose "Skipping powerpc Decimal128 pseudo-registers testcase."
25 return
26}
27
20c2c024 28standard_testfile
5e1a1926
TJB
29
30if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quiet debug}] != "" } {
5b362f04 31 untested "failed to compile"
5e1a1926
TJB
32 return -1
33}
34
35# Start with a fresh gdb.
36
37gdb_exit
38gdb_start
39gdb_reinitialize_dir $srcdir/$subdir
40gdb_load ${binfile}
41
42if { ![runto main] } then {
43 fail "run to main"
44 return
45}
46
cdc7edd7 47if [gdb_test "show arch" ".*currently powerpc:common.*" "checking for PPC arch"] {
ae59b1da 48 return -1
5e1a1926
TJB
49}
50
51gdb_test "next" ""
52
53for {set i 0} {$i < 16} {incr i 1} {
cdc7edd7 54gdb_test "set \$dl$i=d128" "" "set dl$i register"
5e1a1926 55
cdc7edd7 56gdb_test "print \$dl$i" "\\\$$decimal = 1\.2345678910" "print dl$i register as DFP"
5e1a1926
TJB
57
58gdb_test "info reg dl$i" \
adf8243b 59 "dl$i\[ \]*1\.2345678910\[ \t\]*\\(raw 0x2205800000000000000000049c5de09c\\)" \
bb95117e 60 "print dl$i register with the info reg command"
5e1a1926
TJB
61
62gdb_test "info reg f[expr 2*$i]" \
adf8243b 63 "f[expr 2*$i]\[ \]*8\.608957309287334e\-145\[ \t\]*\\(raw 0x2205800000000000\\)" \
bb95117e 64 "testing lower half of dl$i register"
5e1a1926
TJB
65
66gdb_test "info reg f[expr 2*$i+1]" \
adf8243b 67 "f[expr 2*$i+1]\[ \]*9\.7841140127686122e\-314\[ \t\]*\\(raw 0x000000049c5de09c\\)" \
bb95117e 68 "testing upper half of dl$i register"
5e1a1926
TJB
69
70}