Home | History | Annotate | Line # | Download | only in gdb.arch
      1 # Copyright (C) 2016-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 # Contributed by Imagination Technologies, written by Maciej W. Rozycki.
     17 
     18 # Test MIPS Floating Point Control Register handling.
     19 
     20 require {istarget "mips*-*-*"}
     21 
     22 standard_testfile
     23 
     24 if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     25     return
     26 }
     27 
     28 if ![runto_main] {
     29     return
     30 }
     31 
     32 # First check if we have an FPU available in the first place.
     33 gdb_test_multiple "show mipsfpu" "check for MIPS floating-point coprocessor" {
     34     -re "The MIPS floating-point coprocessor .*\(absent\|unknown\).*$gdb_prompt $" {
     35 	unsupported "no MIPS floating-point coprocessor in the processor"
     36 	return
     37     }
     38     -re "The MIPS floating-point coprocessor .*$gdb_prompt $" {
     39 	verbose "MIPS floating-point coprocessor check successful."
     40     }
     41     default {
     42 	fail
     43 	return
     44     }
     45 }
     46 
     47 # Now check that FCRs are accessible and 32-bit wide.
     48 gdb_test "info registers \$fcsr" "fcsr: $hex"
     49 gdb_test "print sizeof \$fcsr" "\\\$$decimal = 4"
     50 gdb_test "info registers \$fir" "fir: $hex"
     51 gdb_test "print sizeof \$fir" "\\\$$decimal = 4"
     52