]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (gfc_match_entry): Allow ENTRY without parentheses even in FUNCTIONs.
authorJakub Jelinek <jakub@redhat.com>
Wed, 6 Jul 2005 22:12:25 +0000 (00:12 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 6 Jul 2005 22:12:25 +0000 (00:12 +0200)
* decl.c (gfc_match_entry): Allow ENTRY without parentheses
even in FUNCTIONs.

* gfortran.fortran-torture/execute/entry_9.f90: New test.

From-SVN: r101672

gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/execute/entry_9.f90 [new file with mode: 0644]

index ea4bf4bfede9e4627d4c73a114e878c2ceca4a38..129b763f7a09eee3746dbfbdb72bad7b8d12d6f1 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * decl.c (gfc_match_entry): Allow ENTRY without parentheses
+       even in FUNCTIONs.
+
 2005-07-03  Kazu Hirata  <kazu@codesourcery.com>
 
        * gfortran.texi, intrinsic.texi: Fix typos.
index c4cadc729483de54642790d53173d35033484825..9852cb0c42b317f65240a2313e19d54f5f55bf18 100644 (file)
@@ -2395,7 +2395,7 @@ gfc_match_entry (void)
   else
     {
       /* An entry in a function.  */
-      m = gfc_match_formal_arglist (entry, 0, 0);
+      m = gfc_match_formal_arglist (entry, 0, 1);
       if (m != MATCH_YES)
        return MATCH_ERROR;
 
index 445ac810b40194d3a6a74deb589f7c501a323e75..817f273352713cf61c8c0c2c521f8bc9d97ec223 100644 (file)
@@ -1,3 +1,7 @@
+2005-07-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * gfortran.fortran-torture/execute/entry_9.f90: New test.
+
 2005-07-06  Fariborz Jahanian <fjahanian@apple.com>
 
        * gcc.dg/20030324-1.c: Remove -fforce-mem option.
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/entry_9.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/entry_9.f90
new file mode 100644 (file)
index 0000000..d29f4b8
--- /dev/null
@@ -0,0 +1,24 @@
+! Test alternate entry points for functions when the result types
+! of all entry points match
+
+       function f1 (a)
+       integer a, f1, e1
+       f1 = 15 + a
+       return
+       entry e1
+       e1 = 42
+       end function
+       function f2 ()
+       real f2, e2
+       entry e2
+       e2 = 45
+       end function
+
+       program entrytest
+       integer f1, e1
+       real f2, e2
+       if (f1 (6) .ne. 21) call abort ()
+       if (e1 () .ne. 42) call abort ()
+       if (f2 () .ne. 45) call abort ()
+       if (e2 () .ne. 45) call abort ()
+       end