* combine.c (make_compound_operation) <SUBREG>: If force_to_mode
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_3.f90
blobb69ae9c10e0844f6a20aa827716036f999e0fed8
1 ! { dg-do run }
3 ! PROCEDURE POINTERS without the PROCEDURE statement
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 real function e1(x)
8 real :: x
9 e1 = x * 3.0
10 end function
12 subroutine e2(a,b)
13 real, intent(inout) :: a
14 real, intent(in) :: b
15 a = a + b
16 end subroutine
18 program proc_ptr_3
20 real, external, pointer :: fp
22 pointer :: sp
23 interface
24 subroutine sp(a,b)
25 real, intent(inout) :: a
26 real, intent(in) :: b
27 end subroutine sp
28 end interface
30 real, external :: e1
32 interface
33 subroutine e2(a,b)
34 real, intent(inout) :: a
35 real, intent(in) :: b
36 end subroutine e2
37 end interface
39 real :: c = 1.2
41 fp => e1
43 if (abs(fp(2.5)-7.5)>0.01) call abort()
45 sp => e2
47 call sp(c,3.4)
49 if (abs(c-4.6)>0.01) call abort()
51 end