aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2016-06-23 15:58:05 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2016-06-23 15:58:05 +0000
commit5b0e27a724e8ddc12065fa1d0848ae7c2495290e (patch)
tree15a9936a35c8faea733bb284959bf1f4484f4c85 /gcc
parentcd64be5bcae8c6f0ccf50aac0e0a16f28e23d042 (diff)
downloadgcc-5b0e27a724e8ddc12065fa1d0848ae7c2495290e.zip
gcc-5b0e27a724e8ddc12065fa1d0848ae7c2495290e.tar.gz
gcc-5b0e27a724e8ddc12065fa1d0848ae7c2495290e.tar.bz2
re PR libfortran/48852 (Invalid spaces in list-directed output of complex constants)
2016-06-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/48852 * io/write.c: Cleaned up whitespace. (write_d, write_e, write_f, write_es, write_en): Use new helper function write_float_0. (write_float_0): New helper function. (get_precision, select_buffer, select_string, write_float_string): New helper functions used in remaining float writing functions. Helper function write_float_string now contains code for writing to kind=4 character internal units. (write_real): Modified to establish working buffers at this level and to use new helper functions. (write_real_g0): Likewise modified. (write_complex): Likewise modified. Gets both float strings before output so that final lengths can be determined which allows right justifying the complex number with no intervening spaces. * io/write_float.def (build_float_string): Renamed from previosly output_float, modified to use buffers passed in from higher functions, builds a null terminated string of the floating point value. Character kind=4 code eliminated. (write_infnan): Likewise modified to use incoming buffers and eliminate kind=4 related code. (OUTPUT_FLOAT_FMT_G): Deleted, functionality moved into FORMAT_FLOAT. (FORMAT_FLOAT): Renamed macro from WRITE_FLOAT. Use build_float_string. (get_float_string): Renamed from write_float, uses FORMAT_FLOAT macro. Buffer allocation removed, now at higher level. PR libgfortran/48852 * gfortran.dg/char4_iunit_1.f03: Update test. * gfortran.dg/f2003_io_5.f03: Update test. * gfortran.dg/real_const_3.f90: Update test. From-SVN: r237735
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gfortran.dg/char4_iunit_1.f032
-rw-r--r--gcc/testsuite/gfortran.dg/f2003_io_5.f034
-rw-r--r--gcc/testsuite/gfortran.dg/real_const_3.f909
4 files changed, 14 insertions, 8 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 55f8dbf..e3c9548 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2016-06-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/48852
+ * gfortran.dg/char4_iunit_1.f03: Update test.
+ * gfortran.dg/f2003_io_5.f03: Update test.
+ * gfortran.dg/real_const_3.f90: Update test.
+
2016-06-23 Andi Kleen <ak@linux.intel.com>
* g++.dg/bprob/bprob.exp: Support autofdo.
diff --git a/gcc/testsuite/gfortran.dg/char4_iunit_1.f03 b/gcc/testsuite/gfortran.dg/char4_iunit_1.f03
index f02cc1a..7d388ad 100644
--- a/gcc/testsuite/gfortran.dg/char4_iunit_1.f03
+++ b/gcc/testsuite/gfortran.dg/char4_iunit_1.f03
@@ -30,5 +30,5 @@ program char4_iunit_1
write(string, '(10x,f3.1,3x,f9.1)') nan, inf
if (string .ne. 4_" NaN Infinity ") call abort
write(string, *) (1.2, 3.4 )
- if (string .ne. 4_" ( 1.20000005 , 3.40000010 ) ") call abort
+ if (string .ne. 4_" (1.20000005,3.40000010)") call abort
end program char4_iunit_1
diff --git a/gcc/testsuite/gfortran.dg/f2003_io_5.f03 b/gcc/testsuite/gfortran.dg/f2003_io_5.f03
index c064e0c..34b8adb 100644
--- a/gcc/testsuite/gfortran.dg/f2003_io_5.f03
+++ b/gcc/testsuite/gfortran.dg/f2003_io_5.f03
@@ -18,9 +18,9 @@ close(99, status="delete")
c = (3.123,4.456)
write(complex,*,decimal="comma") c
-if (complex.ne." ( 3,12299991 ; 4,45599985 )") call abort
+if (complex.ne." (3,12299991;4,45599985)") call abort
c = (0.0, 0.0)
read(complex,*,decimal="comma") c
-if (complex.ne." ( 3,12299991 ; 4,45599985 )") call abort
+if (complex.ne." (3,12299991;4,45599985)") call abort
end
diff --git a/gcc/testsuite/gfortran.dg/real_const_3.f90 b/gcc/testsuite/gfortran.dg/real_const_3.f90
index e4b5de7..c70591d 100644
--- a/gcc/testsuite/gfortran.dg/real_const_3.f90
+++ b/gcc/testsuite/gfortran.dg/real_const_3.f90
@@ -42,15 +42,14 @@ program main
if (trim(adjustl(str)) .ne. 'NaN') call abort
write(str,*) z
- if (trim(adjustl(str)) .ne. '( NaN, NaN)') call abort
+ if (trim(adjustl(str)) .ne. '(NaN,NaN)') call abort
write(str,*) z2
- if (trim(adjustl(str)) .ne. '( NaN, NaN)') call abort
+ if (trim(adjustl(str)) .ne. '(NaN,NaN)') call abort
write(str,*) z3
- if (trim(adjustl(str)) .ne. '( Infinity, -Infinity)') call abort
+ if (trim(adjustl(str)) .ne. '(Inf,-Inf)') call abort
write(str,*) z4
- if (trim(adjustl(str)) .ne. '( 0.00000000 , -0.00000000 )') call abort
-
+ if (trim(adjustl(str)) .ne. '(0.00000000,-0.00000000)') call abort
end program main