aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2004-12-12 22:12:00 +0100
committerTobias Schlüter <tobi@gcc.gnu.org>2004-12-12 22:12:00 +0100
commit23acf4d41122152f857318a67d63a5f4e8f1cb32 (patch)
treeb7dd2268617c982d5207fe5c130a6b43ca3e4668 /gcc
parentc3d003d207ac27d639e18010dae6b7087ead1beb (diff)
downloadgcc-23acf4d41122152f857318a67d63a5f4e8f1cb32.zip
gcc-23acf4d41122152f857318a67d63a5f4e8f1cb32.tar.gz
gcc-23acf4d41122152f857318a67d63a5f4e8f1cb32.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/match.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/common_1.f9021
4 files changed, 33 insertions, 0 deletions
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 <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/18869
+ * match.c (gfc_match_common): Skip whitespace.
+
2004-12-12 Steven G. Kargl <kargls@comcast.net>
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 <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/18869
+ * gfortran.dg/common_1.f90: New test.
+
2004-12-12 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
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