2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_28.f90
blobce383cf799b206f24bff0f6a89891c5f5c10acd6
1 ! { dg-do compile }
3 ! PR 44718: Procedure-pointer name is wrongly regarded as "external procedure"
5 ! Contributed by John McFarland <john.mcfarland@swri.org>
7 MODULE m
9 IMPLICIT NONE
11 CONTAINS
13 FUNCTION func(x) RESULT(y)
14 INTEGER :: x,y
15 y = x *2
16 END FUNCTION func
18 SUBROUTINE sub(x)
19 INTEGER :: x
20 PRINT*, x
21 END SUBROUTINE sub
24 SUBROUTINE use_func()
25 PROCEDURE(func), POINTER :: f
26 INTEGER :: y
27 f => func
28 y = f(2)
29 END SUBROUTINE use_func
31 SUBROUTINE use_sub()
32 PROCEDURE(sub), POINTER :: f
33 f => sub
34 CALL f(2)
35 END SUBROUTINE use_sub
37 END MODULE m