Commit | Line | Data |
---|---|---|
e2882c85 | 1 | # Copyright 2008-2018 Free Software Foundation, Inc. |
bf330350 CU |
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 | |
1cc75e92 | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
bf330350 CU |
15 | # |
16 | # This file is part of the gdb testsuite. | |
17 | ||
18 | # PR server/17457 | |
19 | # Test aarch64 floating point registers q0, q1, v0, v1, fpsr, fpcr | |
20 | ||
4931af25 | 21 | if {![is_aarch64_target]} { |
bf330350 CU |
22 | verbose "Skipping ${gdb_test_file_name}." |
23 | return | |
24 | } | |
25 | ||
26 | standard_testfile | |
5b362f04 | 27 | if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { |
bf330350 CU |
28 | return -1 |
29 | } | |
30 | ||
31 | if ![runto_main] { | |
32 | untested "could not run to main" | |
33 | return -1 | |
34 | } | |
35 | ||
805acca0 | 36 | set endianness [get_endianness] |
bf330350 CU |
37 | |
38 | gdb_test "break ${srcfile}:[gdb_get_line_number "return"]" \ | |
39 | "Breakpoint $decimal at 0x\[0-9a-fA-F\]+: file .*${srcfile}.*\\\." \ | |
40 | "set the breakpoint after setting the fp registers" | |
41 | ||
42 | gdb_test "continue" \ | |
43 | "Continuing.*Breakpoint $decimal.*" \ | |
44 | "continue until breakpoint" | |
45 | ||
46 | if {$endianness == "little"} { | |
47 | set reg_value0 "0x1f1e1d1c1b1a19181716151413121110" | |
48 | set reg_value1 "0x2f2e2d2c2b2a29282726252423222120" | |
49 | } else { | |
50 | set reg_value0 "0x101112131415161718191a1b1c1d1e1f" | |
51 | set reg_value1 "0x202122232425262728292a2b2c2d2e2f" | |
52 | } | |
53 | ||
54 | gdb_test "info registers q0" \ | |
55 | "q0.*{u = $reg_value0, s = $reg_value0.*" \ | |
56 | "check register q0 value" | |
57 | ||
58 | gdb_test "info registers q1" \ | |
59 | "q1.*{u = $reg_value1, s = $reg_value1.*" \ | |
60 | "check register q1 value" | |
61 | ||
62 | gdb_test "info registers v0" \ | |
63 | "v0.*$reg_value0}}}" \ | |
64 | "check register v0 value" | |
65 | ||
66 | gdb_test "info registers v1" \ | |
67 | "v1.*$reg_value1}}}" \ | |
68 | "check register v1 value" | |
69 | ||
70 | gdb_test "info registers fpsr" \ | |
71 | "fpsr.*0x\[0-9a-fA-F\].*" \ | |
72 | "check register fpsr value" | |
73 | ||
74 | gdb_test "info registers fpcr" \ | |
75 | "fpcr.*0x\[0-9a-fA-F\].*" \ | |
76 | "check register fpcr value" | |
77 |