1 # Copyright (C) 2019-2024 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, see <http://www.gnu.org/licenses/>.
16 # This file is part of the gdb testsuite.
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.
23 require allow_altivec_tests
27 if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } {
28 untested "vector register tests for PowerPC"
32 # Check if our test binary can actually run on this processor.
33 clean_restart ${binfile}
37 gdb_test_multiple "" "wait for exit" {
38 -re ".*Illegal instruction.*${gdb_prompt} $" {
39 unsupported "vector register tests for PowerPC"
42 -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
46 # Run the actual test.
47 clean_restart ${binfile}
49 gdb_breakpoint [gdb_get_line_number "marker"]
53 # Wait for the prompt.
54 gdb_test "" "Breakpoint.*at.*" "wait for prompt"
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}.*"