GDB copyright headers update after running GDB's copyright.py script.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.arch / aarch64-fp.exp
1 # Copyright 2008-2016 Free Software Foundation, Inc.
2 #
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.
7 #
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.
12 #
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.
16 #
17 # This file is part of the gdb testsuite.
18
19 # PR server/17457
20 # Test aarch64 floating point registers q0, q1, v0, v1, fpsr, fpcr
21
22 if {![is_aarch64_target]} {
23 verbose "Skipping ${gdb_test_file_name}."
24 return
25 }
26
27 standard_testfile
28 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
29 return -1
30 }
31
32 if ![runto_main] {
33 untested "could not run to main"
34 return -1
35 }
36
37 set endianness "little"
38 set test "show endian"
39 gdb_test_multiple $test $test {
40 -re "(.* )(big|little)( endian.*)$gdb_prompt $" {
41 set endianness $expect_out(2,string)
42 pass "endianness"
43 }
44 }
45
46 gdb_test "break ${srcfile}:[gdb_get_line_number "return"]" \
47 "Breakpoint $decimal at 0x\[0-9a-fA-F\]+: file .*${srcfile}.*\\\." \
48 "set the breakpoint after setting the fp registers"
49
50 gdb_test "continue" \
51 "Continuing.*Breakpoint $decimal.*" \
52 "continue until breakpoint"
53
54 if {$endianness == "little"} {
55 set reg_value0 "0x1f1e1d1c1b1a19181716151413121110"
56 set reg_value1 "0x2f2e2d2c2b2a29282726252423222120"
57 } else {
58 set reg_value0 "0x101112131415161718191a1b1c1d1e1f"
59 set reg_value1 "0x202122232425262728292a2b2c2d2e2f"
60 }
61
62 gdb_test "info registers q0" \
63 "q0.*{u = $reg_value0, s = $reg_value0.*" \
64 "check register q0 value"
65
66 gdb_test "info registers q1" \
67 "q1.*{u = $reg_value1, s = $reg_value1.*" \
68 "check register q1 value"
69
70 gdb_test "info registers v0" \
71 "v0.*$reg_value0}}}" \
72 "check register v0 value"
73
74 gdb_test "info registers v1" \
75 "v1.*$reg_value1}}}" \
76 "check register v1 value"
77
78 gdb_test "info registers fpsr" \
79 "fpsr.*0x\[0-9a-fA-F\].*" \
80 "check register fpsr value"
81
82 gdb_test "info registers fpcr" \
83 "fpcr.*0x\[0-9a-fA-F\].*" \
84 "check register fpcr value"
85
This page took 0.031595 seconds and 4 git commands to generate.