OSDN Git Service

2010-04-24 Kai Tietz <kai.tietz@onevision.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / intrinsic_3.f90
1 ! { dg-do compile }
2 ! { dg-options "-std=f95" }
3 !
4 ! PR 39876: module procedure name that collides with the GNU intrinsic
5 !
6 ! Contributed by Alexei Matveev <alexei.matveev+gcc@gmail.com>
7
8 module p                           
9   implicit none                                                                 
10
11   contains
12
13     subroutine test()
14       implicit none
15       print *, avg(erfc)
16     end subroutine test
17
18     function avg(f)
19       implicit none
20       double precision :: avg
21       interface
22         double precision function f(x)
23           implicit none
24           double precision, intent(in) :: x
25         end function f
26       end interface
27       avg = ( f(1.0D0) + f(2.0D0) ) / 2
28     end function avg
29
30     function erfc(x)
31       implicit none
32       double precision, intent(in) :: x
33       double precision             :: erfc
34       erfc = x
35     end function erfc
36
37 end module p
38
39 ! { dg-final { cleanup-modules "p" } }
40