From 3f18ef378b0e57ce5a30f2710b79f8035b5f1346 Mon Sep 17 00:00:00 2001 From: tobi Date: Sun, 12 Dec 2004 21:12:00 +0000 Subject: [PATCH] gcc/ PR fortran/18869 * match.c (gfc_match_common): Skip whitespace. testsuite/ PR fortran/18869 * gfortran.dg/common_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92064 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/match.c | 2 ++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/common_1.f90 | 21 +++++++++++++++++++++ 4 files changed, 33 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/common_1.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7c63b51..d000e03 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2004-12-12 Tobias Schlueter + + PR fortran/18869 + * match.c (gfc_match_common): Skip whitespace. + 2004-12-12 Steven G. Kargl PR fortran/16581 diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 210de97..cf0c255 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -2306,12 +2306,14 @@ gfc_match_common (void) as = NULL; } + gfc_gobble_whitespace (); if (gfc_match_eos () == MATCH_YES) goto done; if (gfc_peek_char () == '/') break; if (gfc_match_char (',') != MATCH_YES) goto syntax; + gfc_gobble_whitespace (); if (gfc_peek_char () == '/') break; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1777427..05eed5a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-12-12 Tobias Schlueter + + PR fortran/18869 + * gfortran.dg/common_1.f90: New test. + 2004-12-12 Steven G. Kargl Paul Brook diff --git a/gcc/testsuite/gfortran.dg/common_1.f90 b/gcc/testsuite/gfortran.dg/common_1.f90 new file mode 100644 index 0000000..6ee146a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/common_1.f90 @@ -0,0 +1,21 @@ +! { dg-do compile } +! tests various allowed variants of the common statement +! inspired by PR 18869 + +! blank common block + common x + common y, z + common // xx + +! one named common block on a line + common /a/ e + +! appending to a common block + common /a/ g + +! several named common blocks on a line + common /foo/ a, /bar/ b ! note 'a' is also the name of the + ! above common block + common /baz/ c /foobar/ d, /bazbar/ f + + end -- 2.7.4