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