[PATCH 7/57][Arm][GAS] Add support for MVE instructions: vstr/vldr
[binutils-gdb.git] / gdb / testsuite / gdb.arch / powerpc-fpscr-gcore.exp
blob39bcececff2d15551e6f9bae597ede1b548aed1c
1 # Copyright (C) 2018-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 # This tests checks that generating and loading a core file preserves
19 # the correct FPSCR size.
21 if {![istarget "powerpc*-*-linux*"]} then {
22 verbose "Skipping PowerPC test for corefiles with FPSCR."
23 return
26 standard_testfile .c
28 set gen_src [standard_output_file $srcfile]
30 gdb_produce_source $gen_src {
31 int main() {
32 return 0;
36 if {[build_executable "compile" $binfile $gen_src] == -1} {
37 return -1
40 clean_restart $binfile
42 if ![runto_main] then {
43 fail "could not run to main"
44 return -1
47 # Check if our target has FPSCR
48 proc check_fpscr_access {} {
49 global gdb_prompt
51 set test "fpscr register access"
52 gdb_test_multiple "info reg fpscr" "$test" {
53 -re "Invalid register.*\r\n$gdb_prompt $" {
54 unsupported "$test"
55 return 0
57 -re "\r\nfpscr.*\r\n$gdb_prompt $" {
58 pass "$test"
59 return 1
62 return 0
65 if { ![check_fpscr_access] } {
66 return -1
69 set fpscr_size_process [get_integer_valueof "sizeof(\$fpscr)" -1]
71 set core_filename [standard_output_file "$testfile.core"]
72 set core_generated [gdb_gcore_cmd "$core_filename" "generate core file"]
74 if { !$core_generated } {
75 return -1
78 clean_restart
80 set core_loaded [gdb_core_cmd "$core_filename" "load core file"]
82 if { $core_loaded != 1 } {
83 return -1
86 set fpscr_size_corefile [get_integer_valueof "sizeof(\$fpscr)" -2]
88 set test "fpscr size matches"
89 if {$fpscr_size_process == $fpscr_size_corefile} {
90 pass $test
91 } else {
92 fail $test