diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2017-12-29 19:25:31 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2017-12-29 19:25:31 +0000 |
commit | a97de3ccdce3bac856c2b10b57a49a15c94e6ef2 (patch) | |
tree | ebc23eb7b1f0bba3d667758b205b94effcac8d84 /gcc | |
parent | 459e77b859a96bc4dd3cfd53895c8dccfa0de679 (diff) | |
download | gcc-a97de3ccdce3bac856c2b10b57a49a15c94e6ef2.zip gcc-a97de3ccdce3bac856c2b10b57a49a15c94e6ef2.tar.gz gcc-a97de3ccdce3bac856c2b10b57a49a15c94e6ef2.tar.bz2 |
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 <jvdelisle@gcc.gnu.org>
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gfortran.dg/integer_plus.f90 | 12 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/namelist_53.f90 | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/namelist_57.f90 | 2 |
3 files changed, 14 insertions, 2 deletions
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 |