]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.arch/powerpc-vector-regs.exp
Automatic date update in version.in
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / powerpc-vector-regs.exp
1 # Copyright (C) 2019-2024 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, see <http://www.gnu.org/licenses/>.
15
16 # This file is part of the gdb testsuite.
17
18 # Test vector register access on Power. The inferior executes
19 # instructions that fill the vector registers with values ranging from
20 # 0 to 31 in each of the 16 bytes of each corresponding register, and
21 # we then check if gdb sees these same values.
22
23 require allow_altivec_tests
24
25 standard_testfile
26
27 if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } {
28 untested "vector register tests for PowerPC"
29 return
30 }
31
32 # Check if our test binary can actually run on this processor.
33 clean_restart ${binfile}
34
35 gdb_run_cmd
36
37 gdb_test_multiple "" "wait for exit" {
38 -re ".*Illegal instruction.*${gdb_prompt} $" {
39 unsupported "vector register tests for PowerPC"
40 return
41 }
42 -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
43 }
44 }
45
46 # Run the actual test.
47 clean_restart ${binfile}
48
49 gdb_breakpoint [gdb_get_line_number "marker"]
50
51 gdb_run_cmd
52
53 # Wait for the prompt.
54 gdb_test "" "Breakpoint.*at.*" "wait for prompt"
55
56 for {set i 0} {$i < 32} {incr i 1} {
57 gdb_test "p/z \$vr$i.uint128" ".* = 0x(0?[format %x $i]){16}.*"
58 gdb_test "p/z \$v$i.uint128" ".* = 0x(0?[format %x $i]){16}.*"
59 }