OSDN Git Service

2009-09-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Sep 2009 01:18:48 +0000 (01:18 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Sep 2009 01:18:48 +0000 (01:18 +0000)
PR libgfortran/41192
* gfortran.dg/namelist_59.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151496 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/namelist_59.f90 [new file with mode: 0644]

index 27bb3c8..1c00a6b 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/41192
+       * gfortran.dg/namelist_59.f90: New test.
+
 2009-09-07  Bernd Schmidt  <bernd.schmidt@analog.com>
 
        From Mike Frysinger  <michael.frysinger@analog.com>
diff --git a/gcc/testsuite/gfortran.dg/namelist_59.f90 b/gcc/testsuite/gfortran.dg/namelist_59.f90
new file mode 100644 (file)
index 0000000..bb68b9b
--- /dev/null
@@ -0,0 +1,26 @@
+! { dg-do run }
+! PR41192 NAMELIST input with just a comment ("&NAME ! comment \") error 
+program cmdline
+! comment by itself causes error in gfortran
+   call process(' ')
+   call process('i=10 , j=20 k=30 ! change all three values')
+   call process(' ')
+   call process('! change no values')! before patch this failed.
+end program cmdline
+
+subroutine process(string)
+ implicit none
+ character(len=*) :: string
+ character(len=132) :: lines(3)
+ character(len=255) :: message
+ integer :: i=1,j=2,k=3
+ integer ios
+ namelist /cmd/ i,j,k
+ save cmd
+ lines(1)='&cmd'
+ lines(2)=string
+ lines(3)='/'
+
+ read(lines,nml=cmd,iostat=ios,iomsg=message)
+ if (ios.ne.0) call abort
+end subroutine process