diff options
author | Jan Beulich <jbeulich@suse.com> | 2023-05-19 09:16:04 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2023-05-19 09:16:04 +0200 |
commit | 762acf217c4013bed5a4cc679e4bac78d13ce23a (patch) | |
tree | 4f20ebf4c32d4a30e9e8c036a6f623f06145ccea /gas/testsuite | |
parent | df81d460b2d9ec7327a0c1ab2344d7ec62874ce0 (diff) | |
download | gdb-762acf217c4013bed5a4cc679e4bac78d13ce23a.zip gdb-762acf217c4013bed5a4cc679e4bac78d13ce23a.tar.gz gdb-762acf217c4013bed5a4cc679e4bac78d13ce23a.tar.bz2 |
gas: maintain O_constant signedness in more cases
Unary '~' doesn't really produce an unsigned result. Neither does
subtraction (unless taking operand values into consideration). And an
abstract operator applied to two operands which aren't both unsigned
can't be assumed to yield an unsigned result; exceptions are
- shifts, where only signedness of the left hand operand matters,
- comparisons, which - unlike unary '!' - produce signed results (they
deliver 0 or ~0, as opposed to '!', which yields 0 or 1),
- logical operators (yielding 0 or 1 and hence treated like unary '!').
While doing this (specifically while extending the all/quad testcase),
update .quad and .8byte documentation: With 64-bit architectures now
being common, it is highly inappropriate to state that these directives
unconditionally require bignums.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/all/gas.exp | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/all/octa.d | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/all/octa.s | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/all/quad.d | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/all/quad.s | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/all/quad2.d | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/all/quad2.s | 3 |
7 files changed, 36 insertions, 0 deletions
diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp index 53d8253..b7f5835 100644 --- a/gas/testsuite/gas/all/gas.exp +++ b/gas/testsuite/gas/all/gas.exp @@ -428,6 +428,11 @@ if { ![istarget "tic4x*-*-*"] && ![istarget "tic54x*-*-*"] && ![istarget "hppa*- run_dump_test quad +# ~ isn't an operator on PDP-11 +if { ![istarget "pdp11-*-*"] } { + run_dump_test quad2 +} + # poor little PDP-11 can't handle 16-byte values if { ![istarget "pdp11-*-*"] } { run_dump_test octa diff --git a/gas/testsuite/gas/all/octa.d b/gas/testsuite/gas/all/octa.d index 21bc672..e8eff2c 100644 --- a/gas/testsuite/gas/all/octa.d +++ b/gas/testsuite/gas/all/octa.d @@ -6,3 +6,11 @@ Contents of section .data: [^ ]* (ffff3344 55667788 99aabbcc ddeeffff|ffffeedd ccbbaa99 88776655 4433ffff) .* [^ ]* (00003444 55667788 99aabbcc ddeeffff|ffffeedd ccbbaa99 88776655 44340000) .* + [^ ]* (00000080 00000000 00000000 00000000|00000000 00000000 00000000 80000000) .* + [^ ]* (ffffffff 00000000 00000000 00000000|00000000 00000000 00000000 ffffffff) .* + [^ ]* (00000080 ffffffff ffffffff ffffffff|ffffffff ffffffff ffffffff 80000000) .* + [^ ]* (01000000 ffffffff ffffffff ffffffff|ffffffff ffffffff ffffffff 00000001) .* + [^ ]* (ffffff7f ffffffff ffffffff ffffffff|ffffffff ffffffff ffffffff 7fffffff) .* + [^ ]* (00000000 ffffffff ffffffff ffffffff|ffffffff ffffffff ffffffff 00000000) .* + [^ ]* (00000080 ffffffff ffffffff ffffffff|ffffffff ffffffff ffffffff 80000000) .* + [^ ]* (01000000 ffffffff ffffffff ffffffff|ffffffff ffffffff ffffffff 00000001) .* diff --git a/gas/testsuite/gas/all/octa.s b/gas/testsuite/gas/all/octa.s index 0d0ce14..faa21fa 100644 --- a/gas/testsuite/gas/all/octa.s +++ b/gas/testsuite/gas/all/octa.s @@ -1,3 +1,11 @@ .data .octa ~0x112233445566778899aabbcc0000 .octa -347510587133311339321256747728896 + .octa 0x80000000 + .octa 0xffffffff + .octa -0x80000000 + .octa -0xffffffff + .octa ~0x80000000 + .octa ~0xffffffff + .octa 0 - 0x80000000 + .octa 0 - 0xffffffff diff --git a/gas/testsuite/gas/all/quad.d b/gas/testsuite/gas/all/quad.d index d0a8dde..0f186bf 100644 --- a/gas/testsuite/gas/all/quad.d +++ b/gas/testsuite/gas/all/quad.d @@ -8,5 +8,6 @@ Contents of section (\.data|\$DATA\$): 00.. (00000000 87654321 00000000 ffffffff|21436587 00000000 ffffffff 00000000|00000000 65872143 00000000 ffffffff|43218765 00000000 ffffffff 00000000) .* 00.. (ffffffff 89abcdf0 ffffffff 80000000|f0cdab89 ffffffff 00000080 ffffffff|ffffffff ab89f0cd ffffffff 00800000|cdf089ab ffffffff 00008000 ffffffff) .* 00.. (ffffffff 789abcdf ffffffff 00000001|dfbc9a78 ffffffff 01000000 ffffffff|ffffffff 9a78dfbc ffffffff 00000100|bcdf789a ffffffff 00010000 ffffffff) .* + 00.. (ffffffff 80000000 ffffffff 00000001|00000080 ffffffff 01000000 ffffffff|ffffffff 00800000 ffffffff 00000100|00008000 ffffffff 00010000 ffffffff) .* 00.. (01234567 89abcdef fedcba98 76543211|efcdab89 67452301 11325476 98badcfe|23016745 ab89efcd dcfe98ba 54761132|cdef89ab 45670123 32117654 ba98fedc) .* #pass diff --git a/gas/testsuite/gas/all/quad.s b/gas/testsuite/gas/all/quad.s index af250cd..a5da2dc 100644 --- a/gas/testsuite/gas/all/quad.s +++ b/gas/testsuite/gas/all/quad.s @@ -8,5 +8,8 @@ .quad -0x87654321 .quad -0xffffffff + .quad 0 - 0x80000000 + .quad 0 - 0xffffffff + .quad 0x123456789abcdef .quad -0x123456789abcdef diff --git a/gas/testsuite/gas/all/quad2.d b/gas/testsuite/gas/all/quad2.d new file mode 100644 index 0000000..3472925 --- /dev/null +++ b/gas/testsuite/gas/all/quad2.d @@ -0,0 +1,8 @@ +#objdump : -s -j .data -j "\$DATA\$" +#name : .quad binary-not tests + +.*: .* + +Contents of section (\.data|\$DATA\$): + 0000 (ffffffff 7fffffff ffffffff 00000000|ffffff7f ffffffff 00000000 ffffffff) .* +#pass diff --git a/gas/testsuite/gas/all/quad2.s b/gas/testsuite/gas/all/quad2.s new file mode 100644 index 0000000..9695faa --- /dev/null +++ b/gas/testsuite/gas/all/quad2.s @@ -0,0 +1,3 @@ + .data + .quad ~0x80000000 + .quad ~0xffffffff |