GDB copyright headers update after running GDB's copyright.py script.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.arch / powerpc-d128-regs.exp
1 # This testcase is part of GDB, the GNU debugger.
2
3 # Copyright 2008-2016 Free Software Foundation, Inc.
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
23 if ![istarget "powerpc64*-*"] then {
24 verbose "Skipping powerpc Decimal128 pseudo-registers testcase."
25 return
26 }
27
28 set testfile "powerpc-d128-regs"
29 set srcfile ${testfile}.c
30 set binfile ${objdir}/${subdir}/${testfile}
31
32 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quiet debug}] != "" } {
33 untested powerpc-d128-regs.exp
34 return -1
35 }
36
37 # Start with a fresh gdb.
38
39 gdb_exit
40 gdb_start
41 gdb_reinitialize_dir $srcdir/$subdir
42 gdb_load ${binfile}
43
44 if { ![runto main] } then {
45 fail "run to main"
46 return
47 }
48
49 if [gdb_test "show arch" ".*currently powerpc:common.*" "Checking for PPC arch"] {
50 return -1
51 }
52
53 gdb_test "next" ""
54
55 for {set i 0} {$i < 16} {incr i 1} {
56 gdb_test "set \$dl$i=d128" "" "Set dl$i register"
57
58 gdb_test "print \$dl$i" "\\\$$decimal = 1\.2345678910" "Print dl$i register as DFP"
59
60 gdb_test "info reg dl$i" \
61 "dl$i\[ \]*1\.2345678910\[\t\]*\\(raw 0x2205800000000000000000049c5de09c\\)" \
62 "Print dl$i register with the info reg command"
63
64 gdb_test "info reg f[expr 2*$i]" \
65 "f[expr 2*$i]\[ \]*8\.608957309287334e\-145\[\t\]*\\(raw 0x2205800000000000\\)" \
66 "Testing lower half of dl$i register"
67
68 gdb_test "info reg f[expr 2*$i+1]" \
69 "f[expr 2*$i+1]\[ \]*9\.7841140127686122e\-314\[\t\]*\\(raw 0x000000049c5de09c\\)" \
70 "Testing upper half of dl$i register"
71
72 }
This page took 0.03204 seconds and 4 git commands to generate.