From a3197745b1edfd711e345b7c94c68be85eb11e48 Mon Sep 17 00:00:00 2001 From: Bosco Garc?a Date: Thu, 22 Aug 2019 12:54:06 +0100 Subject: Fix the assembler's floating point number parser so that it can correctly handle numbers encoded as a leading decimal point, followed by zeroes, followed by a non-zero sequence. * atof-generic.c (atof_generic): Do not ignore leading zeros if they appear after a decimal point. * testsuite/gas/all/float.s: Extend test to include a number with a leading decimal point followed by several zeroes. * testsuite/gas/i386/fp.s: Likewise. * testsuite/gas/i386/fp.d: Update expected output. --- gas/testsuite/gas/all/float.s | 2 ++ gas/testsuite/gas/i386/fp.d | 1 + gas/testsuite/gas/i386/fp.s | 4 ++++ 3 files changed, 7 insertions(+) (limited to 'gas/testsuite') diff --git a/gas/testsuite/gas/all/float.s b/gas/testsuite/gas/all/float.s index b098cad..902914f 100644 --- a/gas/testsuite/gas/all/float.s +++ b/gas/testsuite/gas/all/float.s @@ -2,3 +2,5 @@ foo: .single 0r1.2345e+06 .single 0f3.14159 .double 0r2.718282 + .double .0000000000000000000001 + .double 1e-22 diff --git a/gas/testsuite/gas/i386/fp.d b/gas/testsuite/gas/i386/fp.d index 21838e2..a9a9538 100644 --- a/gas/testsuite/gas/i386/fp.d +++ b/gas/testsuite/gas/i386/fp.d @@ -6,3 +6,4 @@ Contents of section .data: 0000 00881bcd 4b789ad4 004071a3 79094f93 ....Kx...@q.y.O. 0010 0a40789a 5440789a 54400000 00000000 .@x.T@x.T@...... + 0020 e65e1710 20395e3b e65e1710 20395e3b .\^.. 9\^;.\^.. 9\^; diff --git a/gas/testsuite/gas/i386/fp.s b/gas/testsuite/gas/i386/fp.s index 4187d4e..a1f2b0f 100644 --- a/gas/testsuite/gas/i386/fp.s +++ b/gas/testsuite/gas/i386/fp.s @@ -11,3 +11,7 @@ .single 3.32192809488736218171e0 # .byte 0x78, 0x9a, 0x54, 0x40, 0, 0, 0, 0 .byte 0, 0, 0, 0, 0, 0 + +# The assembler used to treat the next value as zero instead of 1e-22. + .double .0000000000000000000001 + .double 1e-22 -- cgit v1.1