aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-12-23 12:38:35 +0000
committerMaciej W. Rozycki <macro@imgtec.com>2016-12-23 19:28:23 +0000
commit3fb49709438e204177373646585a76116caf23fb (patch)
tree1988549ca34f15eb4248d8d19e47b0c80088e006 /gas/testsuite
parent645c455650ed35460afdacb078c7c58308607fbe (diff)
downloadgdb-3fb49709438e204177373646585a76116caf23fb.zip
gdb-3fb49709438e204177373646585a76116caf23fb.tar.gz
gdb-3fb49709438e204177373646585a76116caf23fb.tar.bz2
MIPS16/GAS: Fix forced size suffixes with argumentless instructions
Correct the handling of `.e' and `.t' instruction size suffixes with instruction mnemonics which are not followed by any text on the same line, such as arguments or white space, e.g.: $ cat test.s .set mips16 foo: entry.t # comment entry.t exit.t # comment exit.t nop.t # comment nop.t $ as -32 -o test.o test.s test.s: Assembler messages: test.s:4: Error: unrecognized opcode `entry.t' test.s:6: Error: unrecognized opcode `exit.t' test.s:8: Error: unrecognized opcode `nop.t' $ gas/ * config/tc-mips.c (mips16_ip): Handle `.e' and `.t' instruction suffixes followed by a null character rather than a space too. * testsuite/gas/mips/mips16-insn-length-noargs.d: New test. * testsuite/gas/mips/mips16-insn-length-noargs.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-insn-length-noargs.d14
-rw-r--r--gas/testsuite/gas/mips/mips16-insn-length-noargs.s12
3 files changed, 27 insertions, 0 deletions
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index c16891a..a5c722c 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -1344,6 +1344,7 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test "mips16-extend-swap"
run_dump_test "mips16-sprel-swap"
run_dump_test "mips16-sdrasp"
+ run_dump_test "mips16-insn-length-noargs"
run_dump_test "mips16-branch-unextended-1"
run_dump_test "mips16-branch-unextended-2"
diff --git a/gas/testsuite/gas/mips/mips16-insn-length-noargs.d b/gas/testsuite/gas/mips/mips16-insn-length-noargs.d
new file mode 100644
index 0000000..1804795
--- /dev/null
+++ b/gas/testsuite/gas/mips/mips16-insn-length-noargs.d
@@ -0,0 +1,14 @@
+#objdump: -d --prefix-addresses --show-raw-insn
+#name: MIPS16 argumentless instruction size override
+#as: -32
+
+.*: +file format .*mips.*
+
+Disassembly of section \.text:
+[0-9a-f]+ <[^>]*> e809 entry
+[0-9a-f]+ <[^>]*> e809 entry
+[0-9a-f]+ <[^>]*> ef09 exit
+[0-9a-f]+ <[^>]*> ef09 exit
+[0-9a-f]+ <[^>]*> 6500 nop
+[0-9a-f]+ <[^>]*> 6500 nop
+ \.\.\.
diff --git a/gas/testsuite/gas/mips/mips16-insn-length-noargs.s b/gas/testsuite/gas/mips/mips16-insn-length-noargs.s
new file mode 100644
index 0000000..b24ff85
--- /dev/null
+++ b/gas/testsuite/gas/mips/mips16-insn-length-noargs.s
@@ -0,0 +1,12 @@
+ .set mips16
+foo:
+ entry.t # comment
+ entry.t
+ exit.t # comment
+ exit.t
+ nop.t # comment
+ nop.t
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16