]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR fortran/45710 (Adjust format and padding for WRITE of NAMELIST group...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 7 Oct 2010 02:38:00 +0000 (02:38 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 7 Oct 2010 02:38:00 +0000 (02:38 +0000)
2010-10-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

Backport from mainline
PR libfortran/45710
* gfortran.dg/namelist_65.f90: New test.

From-SVN: r165080

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

index 0136fb135d3a34fe7f58adb787754ad8d78a6228..710ef1ecdbbaeba6267fe0cb58f4beda9a0f8d36 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       Backport from mainline
+       PR libfortran/45710
+       * gfortran.dg/namelist_65.f90: New test.
+
 2010-10-04  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * gcc.dg/torture/pr45678-1.c: Add -fno-common to options on 32-bit
diff --git a/gcc/testsuite/gfortran.dg/namelist_65.f90 b/gcc/testsuite/gfortran.dg/namelist_65.f90
new file mode 100644 (file)
index 0000000..6ef8ca4
--- /dev/null
@@ -0,0 +1,22 @@
+! { dg-do run }
+! { dg-options "-std=gnu" }
+! PR45710 Adjust format/padding for WRITE of NAMELIST group to internal file
+program oneline
+real :: a=1,b=2,c=3,d=4
+namelist /nl1/ a,b,c
+parameter(ilines=5)
+character(len=80) :: out(ilines)
+
+! fill array out with @
+do i=1,len(out)
+   out(:)(i:i)='@'
+enddo
+
+write(out,nl1)
+if (out(1).ne."&NL1") call abort
+if (out(2).ne." A=  1.0000000    ,") call abort
+if (out(3).ne." B=  2.0000000    ,") call abort
+if (out(4).ne." C=  3.0000000    ,") call abort
+if (out(5).ne." /") call abort
+
+end program oneline