"eqv involving dot" gas test and pdp11
Checks
Commit Message
This changes the eqv-dot test to make 'x' non-zero, so targets
(eg. i386-darwin) that silently ignore the value of fx_subsy in fixups
will fail the test.
When updating the test I noticed seriously odd expected output for
pdp11. Why should .long write in different byte order when needing
fixups (".long z")? That appears to be a bug in the pdp11
md_apply_fix, which reads section contents using pdp-endian but writes
them little-endian. Fix that too.
gas/
* config/tc-pdp11.c (md_apply_fix): Use md_mumber_to_chars.
* testsuite/gas/all/eqv-dot.s: Move x to second .long.
* testsuite/gas/all/eqv-dot.d: Update expected result.
* testsuite/gas/all/eqv-dot-pdp11.d: Likewise, and use
source directive.
* testsuite/gas/all/eqv-dot-pdp11.s: Delete.
* testsuite/gas/all/gas.exp (do_930509a): Support pdp11.
* testsuite/gas/all/simple-forward.d: Likewise.
@@ -287,7 +287,7 @@ md_apply_fix (fixS *fixP,
code &= ~mask;
code |= (val >> shift) & mask;
- number_to_chars_littleendian (buf, code, size);
+ md_number_to_chars (buf, code, size);
if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0)
fixP->fx_done = 1;
@@ -1,3 +1,4 @@
+#source: eqv-dot.s
#objdump: -s -j .data
#name: eqv involving dot (PDP11)
# Special for PDP11 which is little-endian for octets in shorts
@@ -7,6 +8,6 @@
.*: .*
Contents of section \.data:
- 0000 0+0000 0+0100 0+0200 0+0c00 .*
- 0010 0+1000 140+ 0+1000 1c0+ .*
+ 0000 0+0000 0+0100 0+0200 0+0800 .*
+ 0010 0+0c00 0+1000 0+0c00 0+1800 .*
#pass
deleted file mode 100644
@@ -1,8 +0,0 @@
- .data
-x: .long 0, 1, 2, . - x
- y = . - x
- z == . - x
- .long y
- .long z
- .long y
- .long z
@@ -10,6 +10,6 @@
.*: .*
Contents of section \.data:
- 0000 (0+00 0+01 0+02 0+0c|000+ 010+ 020+ 0c0+) .*
- 0010 (0+10 0+14 0+10 0+1c|100+ 140+ 100+ 1c0+) .*
+ 0000 (0+00 0+01 0+02 0+08|000+ 010+ 020+ 080+) .*
+ 0010 (0+0c 0+10 0+0c 0+18|0c0+ 100+ 0c0+ 180+) .*
#pass
@@ -1,5 +1,6 @@
.data
-x: .long 0, 1, 2, . - x
+ .long 0
+x: .long 1, 2, . - x
y = . - x
z == . - x
.long y
@@ -262,13 +262,14 @@ proc do_930509a {} {
set x 0
gas_start "x930509.s" "-al"
while 1 {
-# We need to accommodate both byte orders here.
+# We need to accommodate little, big and pdp endian here.
# If ".long" means an 8-byte value on some target someday, this test will have
# to be fixed.
expect {
-re "^ +1 .... 00 ?00 ?00 ?00" { fail $testname; set x 1 }
-re "^ +1 .... 04 ?00 ?00 ?00" { pass $testname; set x 1 }
-re "^ +1 .... 00 ?00 ?00 ?04" { pass $testname; set x 1 }
+ -re "^ +1 .... 00 ?00 ?04 ?00" { pass $testname; set x 1 }
-re "\[^\n\]*\n" { }
timeout { perror "timeout\n"; break }
eof { break }
@@ -10,5 +10,5 @@
.*: .*
Contents of section \.data:
- 0000 0c000000 (0c000000 0c000000|000c0000 0000000c) .*
+ 0000 0c000000 (0c000000 0c000000|000c0000 0000000c|0c000000 00000c00) .*
#pass