aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
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