From 23acf4d41122152f857318a67d63a5f4e8f1cb32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tobias=20Schl=C3=BCter?= Date: Sun, 12 Dec 2004 22:12:00 +0100 Subject: [PATCH] re PR fortran/18869 (multiple common blocks in a single line rejected) gcc/ PR fortran/18869 * match.c (gfc_match_common): Skip whitespace. testsuite/ PR fortran/18869 * gfortran.dg/common_1.f90: New test. From-SVN: r92064 --- 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 7c63b51b5c1..d000e033279 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 210de97de90..cf0c255524d 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 1777427a0fd..05eed5adcda 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 00000000000..6ee146a5e33 --- /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.30.2