]>
Commit | Line | Data |
---|---|---|
3666a048 | 1 | # Copyright (C) 2019-2021 Free Software Foundation, Inc. |
6f072a10 PFC |
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 | if {![istarget "powerpc*"] || [skip_altivec_tests]} { | |
24 | verbose "Skipping PowerPC vector register tests." | |
25 | return | |
26 | } | |
27 | ||
28 | standard_testfile | |
29 | ||
30 | if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } { | |
31 | untested "vector register tests for PowerPC" | |
32 | return | |
33 | } | |
34 | ||
35 | # Check if our test binary can actually run on this processor. | |
36 | clean_restart ${binfile} | |
37 | ||
38 | gdb_run_cmd | |
39 | ||
40 | gdb_test_multiple "" "wait for exit" { | |
41 | -re ".*Illegal instruction.*${gdb_prompt} $" { | |
42 | unsupported "vector register tests for PowerPC" | |
43 | return | |
44 | } | |
45 | -re ".*$inferior_exited_re normally.*${gdb_prompt} $" { | |
46 | } | |
47 | } | |
48 | ||
49 | # Run the actual test. | |
50 | clean_restart ${binfile} | |
51 | ||
52 | gdb_breakpoint [gdb_get_line_number "marker"] | |
53 | ||
54 | gdb_run_cmd | |
55 | ||
56 | # Wait for the prompt. | |
57 | gdb_test "" "Breakpoint.*at.*" "wait for prompt" | |
58 | ||
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}.*" | |
62 | } |