diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/namelist_89.f90 | 47 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr59700.f90 | 2 |
3 files changed, 54 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9fa77b1..4b8cb01 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-02-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/69456 + * gfortran.dg/namelist_89.f90: New test. + * gfortran.dg/pr59700.f90: Update test.. + 2016-02-23 Martin Sebor <msebor@redhat.com> PR middle-end/69780 diff --git a/gcc/testsuite/gfortran.dg/namelist_89.f90 b/gcc/testsuite/gfortran.dg/namelist_89.f90 new file mode 100644 index 0000000..cfae466 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_89.f90 @@ -0,0 +1,47 @@ +! { dg-do run } +! PR69456 Namelist value with trailing sign is ignored without error +implicit none +integer :: ios +character(256) :: errormsg +real :: r1 = -1 +real :: r2 = -1 +real :: r3 = -1 +real :: r4 = -1 +complex :: c1 = (-1,-1) +namelist /nml/ r1, r2, r3, r4, c1 + +open (99, status="scratch") + +write(99,*) "&nml" +write(99,*) " r1=1+1" ! Treated as 1e+1! +write(99,*) " r2=1-1" ! Treated as 1e-1! +write(99,*) " r3=1+1" ! Treated as 1e+1! +write(99,*) " r4=1-1" ! Treated as 1e-1! +write(99,*) " c1=(1-,1+1)" ! Should give error on item number 5 +write(99,*) "/" + +rewind(99) + +read (99, nml=nml, iostat=ios, iomsg=errormsg) +if (ios.ne.5010) call abort +if (scan(errormsg, "5").ne.44) call abort + +rewind(99) + +write(99,*) "&nml" +write(99,*) " r1=1+1" ! Treated as 1e+1! +write(99,*) " r2=1-" ! Should give error on item number 2 +write(99,*) " r3=1+1" ! Treated as 1e+1! +write(99,*) " r4=1-1" ! Treated as 1e-1! +write(99,*) " c1=(1-1,1+1)" ! Treated as (1e-1,1e+1)! +write(99,*) "/" + +rewind(99) + +read (99, nml=nml, iostat=ios, iomsg=errormsg) +if (ios.ne.5010) call abort +if (scan(errormsg, "2").ne.25) call abort + +close (99) + +end diff --git a/gcc/testsuite/gfortran.dg/pr59700.f90 b/gcc/testsuite/gfortran.dg/pr59700.f90 index 579d8a4..15bf261 100644 --- a/gcc/testsuite/gfortran.dg/pr59700.f90 +++ b/gcc/testsuite/gfortran.dg/pr59700.f90 @@ -35,6 +35,6 @@ program foo rewind(fd) msg = 'ok' read(fd, *, err=40, iomsg=msg) c1, c2 -40 if (msg /= 'Bad floating point number for item 2') call abort +40 if (msg /= 'Bad complex floating point number for item 2') call abort close(fd) end program foo |