Add translations for various sub-directories
[binutils-gdb.git] / gdb / testsuite / gdb.arch / mips-disassembler-options.exp
blobf3862da68b531f401afffb631242ad8d71b6f26f
1 # Copyright 2018-2024 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 # Test MIPS disassembler options.
18 require {istarget "mips*-*-*"}
20 standard_testfile .s
21 set objfile [standard_output_file ${testfile}.o]
23 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {}] \
24      != "" } {
25     return
28 clean_restart ${objfile}
30 proc mips_disassemble_test { func insn mesg } {
31     gdb_test "disassemble $func" \
32         "Dump of assembler code for function\
33          $func:\r\n\[^:\]+:\t$insn\r\nEnd of assembler dump\." \
34         $mesg
37 # Verify defaults.
38 mips_disassemble_test foo "move\tv0,v1" "disassemble default"
40 # Verify option overrides.
41 gdb_test "set disassembler-options gpr-names=numeric"
42 mips_disassemble_test foo "move\t\\\$2,\\\$3" "disassemble numeric, gpr-names"
43 # Check multiple options too.
44 gdb_test "set disassembler-options msa,reg-names=numeric,reg-names=r3000"
45 mips_disassemble_test foo "move\t\\\$2,\\\$3" "disassemble numeric, reg-names"
47 # Verify ABI overrides.
48 mips_disassemble_test bar "move\t\\\$2,\\\$8" "disassemble ABI, numeric"
49 gdb_test "set disassembler-options"
50 gdb_test "set mips abi o32"
51 mips_disassemble_test bar "move\tv0,t0" "disassemble ABI, o32"
52 gdb_test "set mips abi n32"
53 mips_disassemble_test bar "move\tv0,a4" "disassemble ABI, n32"
54 gdb_test "set mips abi n64"
55 mips_disassemble_test bar "move\tv0,a4" "disassemble ABI, n64"