aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-12-09 22:50:07 +0000
committerMaciej W. Rozycki <macro@imgtec.com>2016-12-09 23:19:52 +0000
commitf17ecb4baca990b57cc57e8337c4e03ecee02742 (patch)
tree994ed30c092ff3164f0d1d0157b9d17e0d8cb3c3 /gas/testsuite
parent55af478400524cba7994e353fd9a98ef1543df2f (diff)
downloadgdb-f17ecb4baca990b57cc57e8337c4e03ecee02742.zip
gdb-f17ecb4baca990b57cc57e8337c4e03ecee02742.tar.gz
gdb-f17ecb4baca990b57cc57e8337c4e03ecee02742.tar.bz2
MIPS16/opcodes: Use hexadecimal interpretation for the `e' operand code
Make the `e' operand code used with raw EXTEND instructions use the hexadecimal rather than decimal format, for consistency with what is actually produced by code in `print_insn_mips16' dedicated to EXTEND disassembly. Due to that special handling the operand code is only interpreted for assembly however, which accepts either format either way, so there is no functional change here. opcodes/ * mips16-opc.c (decode_mips16_operand) <'e'>: Use HINT rather than UINT. gas/ * testsuite/gas/mips/mips16-extend.d: New test. * testsuite/gas/mips/mips16-extend.s: New test source. * testsuite/gas/mips/mips.exp: Run the new test.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/mips/mips.exp1
-rw-r--r--gas/testsuite/gas/mips/mips16-extend.d16
-rw-r--r--gas/testsuite/gas/mips/mips16-extend.s23
3 files changed, 40 insertions, 0 deletions
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index e911e1e..38c57f4 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -1295,6 +1295,7 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test "mips16e-64"
run_list_test "mips16e-64" "-march=mips32 -32"
run_dump_test "mips16-intermix"
+ run_dump_test "mips16-extend"
run_dump_test "vxworks1"
run_dump_test "vxworks1-xgot"
diff --git a/gas/testsuite/gas/mips/mips16-extend.d b/gas/testsuite/gas/mips/mips16-extend.d
new file mode 100644
index 0000000..eec0b19
--- /dev/null
+++ b/gas/testsuite/gas/mips/mips16-extend.d
@@ -0,0 +1,16 @@
+#objdump: -d --prefix-addresses --show-raw-insn
+#name: MIPS16 explicit EXTEND encoding
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> f000 0000 addiu s0,sp,0
+[0-9a-f]+ <[^>]*> f001 0000 addiu s0,sp,2048
+[0-9a-f]+ <[^>]*> f5a5 0000 addiu s0,sp,11680
+[0-9a-f]+ <[^>]*> f7ff 0000 addiu s0,sp,-32
+[0-9a-f]+ <[^>]*> f123 0000 addiu s0,sp,6432
+[0-9a-f]+ <[^>]*> f432 0000 addiu s0,sp,-27616
+[0-9a-f]+ <[^>]*> f789 0000 addiu s0,sp,20352
+[0-9a-f]+ <[^>]*> f7ff 0000 addiu s0,sp,-32
+ \.\.\.
diff --git a/gas/testsuite/gas/mips/mips16-extend.s b/gas/testsuite/gas/mips/mips16-extend.s
new file mode 100644
index 0000000..2f779c1
--- /dev/null
+++ b/gas/testsuite/gas/mips/mips16-extend.s
@@ -0,0 +1,23 @@
+ .set mips16
+ .set noreorder
+foo:
+ extend 0
+ addiu $16, $29, 0
+ extend 1
+ addiu $16, $29, 0
+ extend 1445
+ addiu $16, $29, 0
+ extend 2047
+ addiu $16, $29, 0
+ extend 0x123
+ addiu $16, $29, 0
+ extend 0x432
+ addiu $16, $29, 0
+ extend 0x789
+ addiu $16, $29, 0
+ extend 0x7ff
+ addiu $16, $29, 0
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16