PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_result_2.f90
blobf5a4fd221ed051e91bd79ed16da414c7b98c3609
1 ! { dg-do compile }
3 ! PR 36704: Procedure pointer as function result
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 module proc_ptr_15
9 interface
10 function e(x)
11 real :: x
12 procedure(), pointer :: e
13 end function e
14 end interface
16 interface
17 function f(x)
18 real :: x
19 external :: f
20 pointer :: f
21 end function
22 end interface
24 interface
25 function g(x)
26 real :: x
27 pointer :: g
28 external :: g
29 end function
30 end interface
32 contains
34 subroutine point_fun()
35 call set_fun(aux)
36 end subroutine
38 subroutine set_fun(y)
39 external :: y
40 end subroutine
42 function aux()
43 external aux
44 pointer aux
45 intrinsic sin
46 aux => sin
47 end function
49 function foo(x)
50 real :: x
51 interface
52 subroutine foo(i) ! { dg-error "attribute conflicts with" }
53 integer :: i
54 end subroutine
55 end interface
56 !pointer :: foo
57 end function
59 end