Automatic date update in version.in
[binutils-gdb/blckswan.git] / gdb / testsuite / gdb.arch / sparc64-regs.exp
bloba617254863a48cf147502a9fb0fc0f1c2616bac8
1 # Copyright 2017-2022 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of the gdb testsuite.
18 # Tests decoding of various sparc64 registers.
19 # At the moment, only few registers are tested, but more can be added in future.
21 if ![istarget "sparc64*-*-linux*"] then {
22     verbose "Skipping sparc64 register tests."
23     return 0
26 standard_testfile .S
28 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
29     return -1
32 if ![runto_main] then {
33     return 0
36 ##########################################
37 gdb_test "break $srcfile:test_ccr" "Breakpoint \[0-9\] at .*"
38 gdb_test "continue" "Continuing.*"
39 gdb_test "si" "wr .*" "single step to the first %ccr test"
41 proc test_ccr {exp_value exp_text {exp_insn "wr .*"}} {
42     gdb_test "info register ccr" \
43         "ccr            $exp_value      .*$exp_text.*" \
44         "check %ccr register value equal to $exp_text"
46     gdb_test "si" "$exp_insn" "single step to a next %ccr test after $exp_text"
49 test_ccr "0x1" "icc.c"
50 test_ccr "0x2" "icc.v"
51 test_ccr "0x3" "icc.c icc.v"
52 test_ccr "0x4" "icc.z"
53 test_ccr "0x5" "icc.c icc.z"
54 test_ccr "0x6" "icc.v icc.z"
55 test_ccr "0x7" "icc.c icc.v icc.z"
56 test_ccr "0x8" "icc.n"
57 test_ccr "0x9" "icc.c icc.n"
58 test_ccr "0xa" "icc.v icc.n"
59 test_ccr "0xb" "icc.c icc.v icc.n"
60 test_ccr "0xc" "icc.z icc.n"
61 test_ccr "0xd" "icc.c icc.z icc.n"
62 test_ccr "0xe" "icc.v icc.z icc.n"
63 test_ccr "0xf" "icc.c icc.v icc.z icc.n"
65 test_ccr "0x10" "xcc.c"
66 test_ccr "0x20" "xcc.v"
67 test_ccr "0x30" "xcc.c xcc.v"
68 test_ccr "0x40" "xcc.z"
69 test_ccr "0x50" "xcc.c xcc.z"
70 test_ccr "0x60" "xcc.v xcc.z"
71 test_ccr "0x70" "xcc.c xcc.v xcc.z"
72 test_ccr "0x80" "xcc.n"
73 test_ccr "0x90" "xcc.c xcc.n"
74 test_ccr "0xa0" "xcc.v xcc.n"
75 test_ccr "0xb0" "xcc.c xcc.v xcc.n"
76 test_ccr "0xc0" "xcc.z xcc.n"
77 test_ccr "0xd0" "xcc.c xcc.z xcc.n"
78 test_ccr "0xe0" "xcc.v xcc.z xcc.n" "retl"
79 test_ccr "0xf0" "xcc.c xcc.v xcc.z xcc.n" "nop"
80 ##########################################
83 ##########################################
84 set lno [gdb_get_line_number "sparc64-regs.exp: after first %fsr" $srcfile]
85 gdb_test "break $srcfile:$lno" "Breakpoint \[0-9\] at .*" \
86     "forward breakpoint to first %fsr test"
87 gdb_test "continue" "Continuing.*"
89 proc test_fsr {exp_value exp_text} {
90     gdb_test "info register fsr" \
91         "fsr            $exp_value      .*$exp_text.*" \
92         "check %fsr register value equal to $exp_text"
94     gdb_test "si" "stx .*" "single step to a next %fsr test (I.) after $exp_text"
95     gdb_test "si" "ldx .*" "single step to a next %fsr test (II.) after $exp_text"
96     gdb_test "si" "sllx .*" "single step to a next %fsr test (III.) after $exp_text"
99 test_fsr "0x1" "NXC"
100 test_fsr "0x2" "DZC"
101 test_fsr "0x4" "UFC"
102 test_fsr "0x8" "OFC"
103 test_fsr "0x10" "NVC"
104 test_fsr "0x20" "NXA"
105 test_fsr "0x40" "DZA"
106 test_fsr "0x80" "UFA"
107 test_fsr "0x100" "OFA"
108 test_fsr "0x200" "NVA"
109 test_fsr "0x800000" "NXM"
110 test_fsr "0x1000000" "DZM"
111 test_fsr "0x2000000" "UFM"
112 test_fsr "0x4000000" "OFM"
113 test_fsr "0x8000000" "NVM"
114 ##########################################