1! { dg-do compile }
2!
3! PR fortran/34137
4!
5! Entry was previously not possible in a module.
6! Checks also whether the different result combinations
7! work properly.
8!
9module m2
10  implicit none
11contains
12function func(a)
13  implicit none
14  integer :: a, func
15  real :: func2
16  func = a*8
17  return
18entry ent(a) result(func2)
19  ent = -a*4.0 ! { dg-error "is not a variable" }
20  return
21end function func
22end module m2
23
24module m3
25  implicit none
26contains
27function func(a) result(res)
28  implicit none
29  integer :: a, res
30  real :: func2
31  res = a*12
32  return
33entry ent(a) result(func2)
34  ent = -a*6.0 ! { dg-error "is not a variable" }
35  return
36end function func
37end module m3
38