* config/tc-arm.c (arm_cpus): Add entry for ARM Cortex-M0.
[binutils-gdb.git] / gdb / testsuite / gdb.arch / powerpc-d128-regs.exp
blobd4002a5424de752cadd74245d3f2d27a5d0a09ce
1 # This testcase is part of GDB, the GNU debugger.
3 # Copyright 2008, 2009 Free Software Foundation, Inc.
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.
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.
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/>.
18 # Please email any bugs, comments, and/or additions to this file to:
19 # bug-gdb@gnu.org
21 # Testcase for ppc decimal128 pseudo-registers.
23 if $tracelevel then {
24         strace $tracelevel
27 if ![istarget "powerpc64-*"] then {
28     verbose "Skipping powerpc Decimal128 pseudo-registers testcase."
29     return
32 set testfile "powerpc-d128-regs"
33 set srcfile ${testfile}.c
34 set binfile ${objdir}/${subdir}/${testfile}
36 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quiet debug}] != "" } {
37      untested powerpc-d128-regs.exp
38      return -1
41 # Start with a fresh gdb.
43 gdb_exit
44 gdb_start
45 gdb_reinitialize_dir $srcdir/$subdir
46 gdb_load ${binfile}
48 if { ![runto main] } then {
49    fail "run to main"
50    return
53 if [gdb_test "show arch" ".*currently powerpc:common.*" "Checking for PPC arch"] {
54     return -1;
57 gdb_test "next" ""
59 for {set i 0} {$i < 16} {incr i 1} {
60 gdb_test "set \$dl$i=d128" "" "Set dl$i register"
62 gdb_test "print \$dl$i" "\\\$$decimal = 1\.2345678910" "Print dl$i register as DFP"
64 gdb_test "info reg dl$i" \
65          "dl$i\[ \]*1\.2345678910\[\t\]*\\(raw 0x2205800000000000000000049c5de09c\\)" \
66          "Print dl$i register with the info reg command"
68 gdb_test "info reg f[expr 2*$i]" \
69          "f[expr 2*$i]\[ \]*8\.608957309287334e\-145\[\t\]*\\(raw 0x2205800000000000\\)" \
70          "Testing lower half of dl$i register"
72 gdb_test "info reg f[expr 2*$i+1]" \
73          "f[expr 2*$i+1]\[ \]*9\.7841140127686122e\-314\[\t\]*\\(raw 0x000000049c5de09c\\)" \
74          "Testing upper half of dl$i register"