gdb - avx512: tests were failing due to missing memory aligment.
[external/binutils.git] / gdb / testsuite / gdb.arch / aarch64-fp.exp
1 # Copyright 2008-2017 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 "failed to prepare" ${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 [get_endianness]
38
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"
42
43 gdb_test "continue" \
44     "Continuing.*Breakpoint $decimal.*" \
45     "continue until breakpoint"
46
47 if {$endianness == "little"} {
48     set reg_value0 "0x1f1e1d1c1b1a19181716151413121110"
49     set reg_value1 "0x2f2e2d2c2b2a29282726252423222120"
50 } else {
51     set reg_value0 "0x101112131415161718191a1b1c1d1e1f"
52     set reg_value1 "0x202122232425262728292a2b2c2d2e2f"
53 }
54
55 gdb_test "info registers q0" \
56     "q0.*{u = $reg_value0, s = $reg_value0.*" \
57     "check register q0 value"
58
59 gdb_test "info registers q1" \
60     "q1.*{u = $reg_value1, s = $reg_value1.*" \
61     "check register q1 value"
62
63 gdb_test "info registers v0" \
64     "v0.*$reg_value0}}}" \
65     "check register v0 value"
66
67 gdb_test "info registers v1" \
68     "v1.*$reg_value1}}}" \
69     "check register v1 value"
70
71 gdb_test "info registers fpsr" \
72     "fpsr.*0x\[0-9a-fA-F\].*" \
73     "check register fpsr value"
74
75 gdb_test "info registers fpcr" \
76     "fpcr.*0x\[0-9a-fA-F\].*" \
77     "check register fpcr value"
78