aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorJohn Darrington <john@darrington.wattle.id.au>2019-05-22 07:16:14 +0200
committerJohn Darrington <john@darrington.wattle.id.au>2019-05-22 08:13:36 +0200
commit22c6ccb89e0f38a70a42fb49eb167e7857d51f5c (patch)
tree53939413dadacc46e7b3c2975212e52e9cf5ad6d /gas/testsuite
parenta7df56e5f840e2ce8bb09487ee0b6570cddb1550 (diff)
downloadgdb-22c6ccb89e0f38a70a42fb49eb167e7857d51f5c.zip
gdb-22c6ccb89e0f38a70a42fb49eb167e7857d51f5c.tar.gz
gdb-22c6ccb89e0f38a70a42fb49eb167e7857d51f5c.tar.bz2
S12Z: GAS: New option --mdollar-hex.
This option (also implied by --traditional) causes '$' to introduce literal hexadecimal constants, rather than the modern convention '0x'. gas/ * config/tc-s12z.c (s12z_strtol): New function. (md_show_usage): Update. (md_parse_option): new case OPTION_DOLLAR_HEX. (s12z_init_after_args): (<global>): Use s12z_strtol instead of strtol. * doc/c-s12z.texi (S12Z Options): Document new option -mdollar-hex. * testsuite/gas/s12z/dollar-hex.d: New file. * testsuite/gas/s12z/dollar-hex.s: New file. * testsuite/gas/s12z/s12z.exp: Add them.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/s12z/dollar-hex.d16
-rw-r--r--gas/testsuite/gas/s12z/dollar-hex.s4
-rw-r--r--gas/testsuite/gas/s12z/s12z.exp1
3 files changed, 21 insertions, 0 deletions
diff --git a/gas/testsuite/gas/s12z/dollar-hex.d b/gas/testsuite/gas/s12z/dollar-hex.d
new file mode 100644
index 0000000..dbd4269
--- /dev/null
+++ b/gas/testsuite/gas/s12z/dollar-hex.d
@@ -0,0 +1,16 @@
+#objdump: -d
+#name: Dollar sign as literal hex prefix
+#source: dollar-hex.s --mdollar-hex
+
+tmpdir/dollar-hex.o: file format elf32-s12z
+
+
+Disassembly of section .text:
+
+00000000 <.text>:
+ 0: 1c bc e0 18 mov.b d0, \(24,s\)
+ 4: dc fa 12 34 neg.b 1193046
+ 8: 56
+ 9: 98 12 34 56 ld x, #1193046
+ d: aa e1 dd jmp \(-35,s\)
+
diff --git a/gas/testsuite/gas/s12z/dollar-hex.s b/gas/testsuite/gas/s12z/dollar-hex.s
new file mode 100644
index 0000000..57f12a9
--- /dev/null
+++ b/gas/testsuite/gas/s12z/dollar-hex.s
@@ -0,0 +1,4 @@
+ mov.b d0, ($18,s)
+ neg.b $123456
+ ld x, #$123456
+ jmp (-$23, s) ; Make sure this isn't misinterpreted as the start of a predecrement operand
diff --git a/gas/testsuite/gas/s12z/s12z.exp b/gas/testsuite/gas/s12z/s12z.exp
index cccfc6e..4e567f9 100644
--- a/gas/testsuite/gas/s12z/s12z.exp
+++ b/gas/testsuite/gas/s12z/s12z.exp
@@ -142,3 +142,4 @@ run_dump_test imm-dest
# Miscellaneous
run_dump_test reg-prefix
+run_dump_test dollar-hex