re PR fortran/65903 (Line continuation followed by comment character in string fails...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 16 May 2015 17:51:41 +0000 (17:51 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 16 May 2015 17:51:41 +0000 (17:51 +0000)
2015-05-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/65903
* gfortran.dg/continuation_13.f90: Update test.
* gfortran.dg/pr65903.f90: New test.

From-SVN: r223249

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

index b3aa87ca73c9145eb40dd0aaf0e8cebef977a311..6732ed6dc047313dffdc8af7c6573a2c74738c45 100644 (file)
@@ -1,3 +1,9 @@
+2015-05-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/65903
+       * gfortran.dg/continuation_13.f90: Update test.
+       * gfortran.dg/pr65903.f90: New test.
+
 2015-05-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/66113
index 18528121931b2169faf1d99dd24e0550aa45c51c..95ff1f9f9e90169e9df6f855b35912ef9796555d 100644 (file)
@@ -17,8 +17,11 @@ character(25) :: astring
     )
 700 format('This format now works.'''& !comment
     )
+! See PR65903 for the following cases.
 800 format('This is actually ok.'& !comment
    ' end'  )
+900 format('This is actually ok.' & !comment
+   ' end'  )
 write(astring,100)
 if (astring.ne."This format is OK.") call abort
 write(astring,200)
@@ -34,6 +37,8 @@ if (astring.ne."This format now works.'") call abort
 write(astring,700)
 if (astring.ne."This format now works.'") call abort
 write(astring,800)
+if (astring.ne."This is actually ok.' end") call abort
+write(astring,900)
 if (astring.ne."This is actually ok. end") call abort
 
 end
diff --git a/gcc/testsuite/gfortran.dg/pr65903.f90 b/gcc/testsuite/gfortran.dg/pr65903.f90
new file mode 100644 (file)
index 0000000..20e78ca
--- /dev/null
@@ -0,0 +1,20 @@
+! { dg-do run }
+! { dg-options "-std=gnu" }
+! 
+character(20) :: astring
+
+100 format ("& notblank !")
+200 format ("&          !")
+300 format ("&!")
+
+write(astring,100)
+if (astring.ne."& notblank !") call abort
+!print *, astring
+write(astring,200)
+if (astring.ne."&          !") call abort
+!print *, astring
+write(astring,300)
+if (astring.ne."&!") call abort
+!print *, astring
+
+end