1 # Copyright (C) 2019 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 if {![istarget "powerpc*"] || [skip_altivec_tests]} {
24 verbose "Skipping PowerPC vector register tests."
30 if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } {
31 untested "vector register tests for PowerPC"
35 # Check if our test binary can actually run on this processor.
36 clean_restart ${binfile}
40 gdb_test_multiple "" "wait for exit" {
41 -re ".*Illegal instruction.*${gdb_prompt} $" {
42 unsupported "vector register tests for PowerPC"
45 -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
49 # Run the actual test.
50 clean_restart ${binfile}
52 gdb_breakpoint [gdb_get_line_number "marker"]
56 # Wait for the prompt.
57 gdb_test "" "Breakpoint.*at.*" "wait for prompt"
59 for {set i 0} {$i < 32} {incr i 1} {
60 gdb_test "p/z \$vr$i.uint128" ".* = 0x(0?[format %x $i]){16}.*"
61 gdb_test "p/z \$v$i.uint128" ".* = 0x(0?[format %x $i]){16}.*"