]>
Commit | Line | Data |
---|---|---|
42a4f53d | 1 | # Copyright (C) 2016-2019 Free Software Foundation, Inc. |
78b86327 MR |
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 | if { ![istarget "mips*-*-*"] } then { | |
21 | verbose "Skipping MIPS Floating Point Control Register tests." | |
22 | return | |
23 | } | |
24 | ||
25 | standard_testfile | |
26 | ||
5b362f04 | 27 | if { [prepare_for_testing "failed to prepare" ${testfile}] } { |
78b86327 MR |
28 | return |
29 | } | |
30 | ||
31 | if ![runto_main] { | |
32 | return | |
33 | } | |
34 | ||
35 | # First check if we have an FPU available in the first place. | |
36 | gdb_test_multiple "show mipsfpu" "check for MIPS floating-point coprocessor" { | |
37 | -re "The MIPS floating-point coprocessor .*\(absent\|unknown\).*$gdb_prompt $" { | |
38 | unsupported "no MIPS floating-point coprocessor in the processor" | |
39 | return | |
40 | } | |
41 | -re "The MIPS floating-point coprocessor .*$gdb_prompt $" { | |
42 | verbose "MIPS floating-point coprocessor check successful." | |
43 | } | |
44 | default { | |
45 | fail | |
46 | return | |
47 | } | |
48 | } | |
49 | ||
50 | # Now check that FCRs are accessible and 32-bit wide. | |
51 | gdb_test "info registers \$fcsr" "fcsr: $hex" | |
52 | gdb_test "print sizeof \$fcsr" "\\\$$decimal = 4" | |
53 | gdb_test "info registers \$fir" "fir: $hex" | |
54 | gdb_test "print sizeof \$fir" "\\\$$decimal = 4" |