aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorArnold Metselaar <arnold.metselaar@planet.nl>2010-12-05 21:44:08 +0000
committerArnold Metselaar <arnold.metselaar@planet.nl>2010-12-05 21:44:08 +0000
commit761025beb317a952383f080898386095c512c5ab (patch)
tree7c716cf0c1793b4a79c80104995f051235997f02 /gas/testsuite
parent7353ec481f17a109e657b0842bbd774f9c769bbd (diff)
downloadgdb-761025beb317a952383f080898386095c512c5ab.zip
gdb-761025beb317a952383f080898386095c512c5ab.tar.gz
gdb-761025beb317a952383f080898386095c512c5ab.tar.bz2
PR gas/12269
* config/tc-z80.c (emit_mx, emit_ldxhl): Do not use symbol_get_value_expression on a symbol that may not yet have a value. * testsuite/gas/z80/atend.s: New file, test case for bug 12269, provided by Chris Smith. * testsuite/gas/z80/atend.d: New file, expected results for atend.s. * testsuite/gas/z80/z80.exp: Run new test case.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/z80/atend.d13
-rw-r--r--gas/testsuite/gas/z80/atend.s15
-rw-r--r--gas/testsuite/gas/z80/z80.exp2
3 files changed, 30 insertions, 0 deletions
diff --git a/gas/testsuite/gas/z80/atend.d b/gas/testsuite/gas/z80/atend.d
new file mode 100644
index 0000000..e0427b1
--- /dev/null
+++ b/gas/testsuite/gas/z80/atend.d
@@ -0,0 +1,13 @@
+#objdump: -d
+#name: index intructions with label as offset
+
+.*: .*
+
+Disassembly of section .text:
+
+00000000 <begin>:
+[ ]+0:[ ]+3e 20[ ]+ld a,0x20
+[ ]+2:[ ]+dd 7e 20[ ]+ld a,\(ix\+32\)
+[ ]+5:[ ]+3e 40[ ]+ld a,0x40
+[ ]+7:[ ]+dd 7e 40[ ]+ld a,\(ix\+64\)
+[ ]+a:[ ]+c9[ ]+ret
diff --git a/gas/testsuite/gas/z80/atend.s b/gas/testsuite/gas/z80/atend.s
new file mode 100644
index 0000000..2fd6725
--- /dev/null
+++ b/gas/testsuite/gas/z80/atend.s
@@ -0,0 +1,15 @@
+begin:
+
+offsetAtStart: equ 32
+
+ LD A, offsetAtStart
+ LD A, (IX + offsetAtStart)
+
+ LD A, offsetAtEnd
+ LD A, (IX + offsetAtEnd)
+
+ RET
+
+offsetAtEnd: equ 64
+ END
+
diff --git a/gas/testsuite/gas/z80/z80.exp b/gas/testsuite/gas/z80/z80.exp
index 0cb8440..43a3360 100644
--- a/gas/testsuite/gas/z80/z80.exp
+++ b/gas/testsuite/gas/z80/z80.exp
@@ -11,6 +11,8 @@ if [istarget z80-*-*] then {
run_dump_test "suffix"
# test assembling and disassembling instructions involving offsets
run_dump_test "offset"
+# test assembling instruction with offset that is a label defined later
+ run_dump_test "atend"
# test for data transfer instructions
run_dump_test "ld-group"
# test for block instructions