summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/entry_9.f90
blob: 5dcb6e3b173c8d124f5e77f38c42a75cde45392a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
! { dg-do run }
! Check whether RESULT of ENTRY defaults to entry-name.
! PR fortran/30873
!
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
!
MODULE M1
  CONTAINS
    FUNCTION F2(K)
      INTEGER :: F2,K
      F2=E1(K)
    END FUNCTION F2

    RECURSIVE FUNCTION F1(I)
      INTEGER :: F1,I,E1
      F1=F2(I)
      RETURN
     ENTRY E1(I)
      E1=-I
      RETURN
    END FUNCTION F1
END  MODULE M1

program main
  use m1
  if (E1(5) /= -5) call abort()
  if (F2(4) /= -4) call abort()
  if (F1(1) /= -1) call abort()
end program main

! { dg-final { cleanup-modules "m1" } }