1 # Copyright 2008-2017 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, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # This file is part of the gdb testsuite.
20 # Test aarch64 floating point registers q0, q1, v0, v1, fpsr, fpcr
22 if {![is_aarch64_target]} {
23 verbose "Skipping ${gdb_test_file_name}."
28 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
33 untested "could not run to main"
37 set endianness [get_endianness]
39 gdb_test "break ${srcfile}:[gdb_get_line_number "return"]" \
40 "Breakpoint $decimal at 0x\[0-9a-fA-F\]+: file .*${srcfile}.*\\\." \
41 "set the breakpoint after setting the fp registers"
44 "Continuing.*Breakpoint $decimal.*" \
45 "continue until breakpoint"
47 if {$endianness == "little"} {
48 set reg_value0 "0x1f1e1d1c1b1a19181716151413121110"
49 set reg_value1 "0x2f2e2d2c2b2a29282726252423222120"
51 set reg_value0 "0x101112131415161718191a1b1c1d1e1f"
52 set reg_value1 "0x202122232425262728292a2b2c2d2e2f"
55 gdb_test "info registers q0" \
56 "q0.*{u = $reg_value0, s = $reg_value0.*" \
57 "check register q0 value"
59 gdb_test "info registers q1" \
60 "q1.*{u = $reg_value1, s = $reg_value1.*" \
61 "check register q1 value"
63 gdb_test "info registers v0" \
64 "v0.*$reg_value0}}}" \
65 "check register v0 value"
67 gdb_test "info registers v1" \
68 "v1.*$reg_value1}}}" \
69 "check register v1 value"
71 gdb_test "info registers fpsr" \
72 "fpsr.*0x\[0-9a-fA-F\].*" \
73 "check register fpsr value"
75 gdb_test "info registers fpcr" \
76 "fpcr.*0x\[0-9a-fA-F\].*" \
77 "check register fpcr value"