diff options
author | aldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-11 16:38:42 +0000 |
---|---|---|
committer | aldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-11 16:38:42 +0000 |
commit | 336ce15dac060228fee60041ef2e11c64e2b5f72 (patch) | |
tree | d9b06e2f47a109c2f1a6686b09e8af25f2643eaf | |
parent | 6c17c071159c453d861c9b423ab6633e8bcab6a0 (diff) | |
download | gcc-336ce15dac060228fee60041ef2e11c64e2b5f72.tar.gz |
gcc/fortran:
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
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/scanner.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/literal_character_constant_1.inc | 20 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/literal_character_constant_1_x.F | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/literal_character_constant_1_y.F | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/literal_character_constant_1_z.F | 5 |
7 files changed, 54 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 12894296a2e..4dbc1565d2a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -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 diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index 4b76f9c73e9..0b21e96497e 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index efd6594e8ac..7347547b05e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 00000000000..ba24966b72a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/literal_character_constant_1.inc @@ -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 index 00000000000..ceb2bd98d04 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/literal_character_constant_1_x.F @@ -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 index 00000000000..015d1d8d109 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/literal_character_constant_1_y.F @@ -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 index 00000000000..3f2ac2a427b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/literal_character_constant_1_z.F @@ -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" |