re PR fortran/64506 (FORMAT Parse Error with Continuation Line)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 13 Feb 2015 17:09:04 +0000 (17:09 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 13 Feb 2015 17:09:04 +0000 (17:09 +0000)
2015-02-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/64506
* gfortran.dg/continuation_13.f90: New test.
* gfortran.dg/continuation_14.f: New test.

From-SVN: r220688

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

index efdc9dce3178d315562558d4843dcccd281dfd70..b650ac7de5397b4a10ba2a643f1be33da560d3df 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/64506
+       * gfortran.dg/continuation_13.f90: New test.
+       * gfortran.dg/continuation_14.f: New test.
+
 2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/64970
diff --git a/gcc/testsuite/gfortran.dg/continuation_13.f90 b/gcc/testsuite/gfortran.dg/continuation_13.f90
new file mode 100644 (file)
index 0000000..1852812
--- /dev/null
@@ -0,0 +1,39 @@
+! { dg-do run }
+! { dg-options "-std=gnu" }
+! PR64506
+character(25) :: astring
+
+100 format('This format is OK.'&
+    )
+200 format('This format now works.'&!comment
+    )
+300 format('This format now works.'& !comment
+    )
+400 format('This format is OK.' &!comment
+    )
+500 format('This format is OK.' & !comment
+    )
+600 format('This format now works.'''&!comment
+    )
+700 format('This format now works.'''& !comment
+    )
+800 format('This is actually ok.'& !comment
+   ' end'  )
+write(astring,100)
+if (astring.ne."This format is OK.") call abort
+write(astring,200)
+if (astring.ne."This format now works.") call abort
+write(astring,300)
+if (astring.ne."This format now works.") call abort
+write(astring,400)
+if (astring.ne."This format is OK.") call abort
+write(astring,500)
+if (astring.ne."This format is OK.") call abort
+write(astring,600)
+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
+
+end
diff --git a/gcc/testsuite/gfortran.dg/continuation_14.f b/gcc/testsuite/gfortran.dg/continuation_14.f
new file mode 100644 (file)
index 0000000..a001903
--- /dev/null
@@ -0,0 +1,30 @@
+! { dg-do run }
+! { dg-options "-std=gnu" }
+! PR64506 fixed form source
+      character(25) :: astring
+
+ 100  format('This format is OK.'
+     &)
+ 200  format('This format works now.'!comment << FAILS
+     &)
+ 300  format('This format is OK.' !comment
+     &)
+ 400  format('This format is OK.'  !comment
+     &)
+ 500  format('This format is now OK.'''!comment
+     &   )
+ 600  format('This format is OK.''' !comment
+     &   )
+      write(astring,100)
+      if (astring.ne."This format is OK.") call abort
+      write(astring,200)
+      if (astring.ne."This format works now.") call abort
+      write(astring,300)
+      if (astring.ne."This format is OK.") call abort
+      write(astring,400)
+      if (astring.ne."This format is OK.") call abort
+      write(astring,500)
+      if (astring.ne."This format is now OK.'") call abort
+      write(astring,600)
+      if (astring.ne."This format is OK.'") call abort
+      end