gcc/fortran:
authoraldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Jan 2006 16:38:42 +0000 (16:38 +0000)
committeraldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Jan 2006 16:38:42 +0000 (16:38 +0000)
2006-01-11  Bernhard Fischer  <rep.nop@aon.at>

PR fortran/25486
* scanner.c (load_line): use maxlen to determine the line-length used
for padding lines in fixed form.

gcc/testsuite:
2006-01-10  Bernhard Fischer  <rep.nop@aon.at>

PR fortran/25486
* gfortran.dg/literal_character_constant_1_x.F: New test.
* gfortran.dg/literal_character_constant_1_y.F: Ditto.
* gfortran.dg/literal_character_constant_1_z.F: Ditto.
* gfortran.dg/literal_character_constant_1.inc: Helper for new tests.

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

gcc/fortran/ChangeLog
gcc/fortran/scanner.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/literal_character_constant_1.inc [new file with mode: 0644]
gcc/testsuite/gfortran.dg/literal_character_constant_1_x.F [new file with mode: 0644]
gcc/testsuite/gfortran.dg/literal_character_constant_1_y.F [new file with mode: 0644]
gcc/testsuite/gfortran.dg/literal_character_constant_1_z.F [new file with mode: 0644]

index 1289429..4dbc156 100644 (file)
@@ -1,3 +1,9 @@
+2006-01-11  Bernhard Fischer  <rep.nop@aon.at>
+
+       PR fortran/25486
+       * scanner.c (load_line): use maxlen to determine the line-length used
+       for padding lines in fixed form.
+
 2005-01-11  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/25730
index 4b76f9c..0b21e96 100644 (file)
@@ -809,11 +809,13 @@ load_line (FILE * input, char **pbuf, int *pbuflen)
 
   /* Pad lines to the selected line length in fixed form.  */
   if (gfc_current_form == FORM_FIXED
-      && gfc_option.fixed_line_length > 0
+      && gfc_option.fixed_line_length != 0
       && !preprocessor_flag
       && c != EOF)
-    while (i++ < gfc_option.fixed_line_length)
-      *buffer++ = ' ';
+    {
+      while (i++ < maxlen)
+       *buffer++ = ' ';
+    }
 
   *buffer = '\0';
   *pbuflen = buflen;
index efd6594..7347547 100644 (file)
@@ -1,3 +1,11 @@
+2006-01-10  Bernhard Fischer  <rep.nop@aon.at>
+
+       PR fortran/25486
+       * gfortran.dg/literal_character_constant_1_x.F: New test.
+       * gfortran.dg/literal_character_constant_1_y.F: Ditto.
+       * gfortran.dg/literal_character_constant_1_z.F: Ditto.
+       * gfortran.dg/literal_character_constant_1.inc: Helper for new tests.
+
 2006-01-11  Nathan Sidwell  <nathan@codesourcery.com>
 
        * g++.dg/ext/packed3.C: Add expected packed error.
diff --git a/gcc/testsuite/gfortran.dg/literal_character_constant_1.inc b/gcc/testsuite/gfortran.dg/literal_character_constant_1.inc
new file mode 100644 (file)
index 0000000..ba24966
--- /dev/null
@@ -0,0 +1,20 @@
+C     fixed-form literal character constant with continuation line padding test
+C     PR fortran/25486
+      program a
+      character(len=90) c
+      character(90) :: fil
+c A tab is between 8 and 9.
+      c = '1234567
+     &8        9'
+      write(fil,'(a)') c
+#ifdef LL_NONE
+      if(fil.ne. "12345678     9")
+     &  call abort
+#else
+      if(fil.ne.
+     &"1234567                                                      8  9"
+     &)
+     &  call abort
+#endif
+      end
+
diff --git a/gcc/testsuite/gfortran.dg/literal_character_constant_1_x.F b/gcc/testsuite/gfortran.dg/literal_character_constant_1_x.F
new file mode 100644 (file)
index 0000000..ceb2bd9
--- /dev/null
@@ -0,0 +1,5 @@
+! { dg-do run }
+C     fixed-form literal character constant with continuation line padding test
+C     PR fortran/25486
+! { dg-options "" }
+#include "literal_character_constant_1.inc"
diff --git a/gcc/testsuite/gfortran.dg/literal_character_constant_1_y.F b/gcc/testsuite/gfortran.dg/literal_character_constant_1_y.F
new file mode 100644 (file)
index 0000000..015d1d8
--- /dev/null
@@ -0,0 +1,5 @@
+! { dg-do run }
+C     fixed-form literal character constant with continuation line padding test
+C     PR fortran/25486
+! { dg-options "-ffixed-line-length-72" }
+#include "literal_character_constant_1.inc"
diff --git a/gcc/testsuite/gfortran.dg/literal_character_constant_1_z.F b/gcc/testsuite/gfortran.dg/literal_character_constant_1_z.F
new file mode 100644 (file)
index 0000000..3f2ac2a
--- /dev/null
@@ -0,0 +1,5 @@
+! { dg-do run }
+C     fixed-form literal character constant with continuation line padding test
+C     PR fortran/25486
+! { dg-options "-ffixed-line-length-none -DLL_NONE" }
+#include "literal_character_constant_1.inc"