From a97de3ccdce3bac856c2b10b57a49a15c94e6ef2 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Fri, 29 Dec 2017 19:25:31 +0000 Subject: re PR fortran/83560 (list-directed formatting of INTEGER is missing plus on output when output open with SIGN='PLUS') 2017-12-29 Jerry DeLisle PR libgfortran/83560 * io/write.c (write_integer): Modify to use write_decimal. For namelist mode, suppress leading blanks and emit them as trailing blanks. Change parameter from len to kind for better readability. (nml_write_obj): Fix comment style. From-SVN: r256034 --- gcc/testsuite/gfortran.dg/integer_plus.f90 | 12 ++++++++++++ gcc/testsuite/gfortran.dg/namelist_53.f90 | 2 +- gcc/testsuite/gfortran.dg/namelist_57.f90 | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/integer_plus.f90 (limited to 'gcc') diff --git a/gcc/testsuite/gfortran.dg/integer_plus.f90 b/gcc/testsuite/gfortran.dg/integer_plus.f90 new file mode 100644 index 0000000..695f9d3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/integer_plus.f90 @@ -0,0 +1,12 @@ +! { dg-run run ) +! PR83560 list-directed formatting of INTEGER is missing plus on output +! when output open with SIGN='PLUS' +character(64) :: astring +i=789 +open(unit=10, status='scratch', sign='plus') +write(10,*) i +rewind(10) +read(10,*) astring +close (10) +if (astring.ne.'+789') call abort +end diff --git a/gcc/testsuite/gfortran.dg/namelist_53.f90 b/gcc/testsuite/gfortran.dg/namelist_53.f90 index d4fdf57..9e5692a 100644 --- a/gcc/testsuite/gfortran.dg/namelist_53.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_53.f90 @@ -5,5 +5,5 @@ n = 123 line = "" write(line,nml=stuff) - if (line.ne."&STUFF N= 123, /") call abort + if (line.ne."&STUFF N=123 , /") print *, line end diff --git a/gcc/testsuite/gfortran.dg/namelist_57.f90 b/gcc/testsuite/gfortran.dg/namelist_57.f90 index 7db4c4b..a110fa0 100644 --- a/gcc/testsuite/gfortran.dg/namelist_57.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_57.f90 @@ -7,6 +7,6 @@ line = "" write(line,nml=stuff) if (line(1) .ne. "&STUFF") call abort - if (line(2) .ne. " N= 123,") call abort + if (line(2) .ne. " N=123 ,") call abort if (line(3) .ne. " /") call abort end -- cgit v1.1