* cfgloopmanip.c (duplicate_loop_to_header_edge): Cleanup profile
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_30.f90
blob5996deecb814e51c547bcd968afb39ca3cafc176
1 ! { dg-do compile }
3 ! PR 46067: [F03] invalid procedure pointer assignment not detected
5 ! Contributed by Stephen J. Bespalko <sjbespa@comcast.net>
7 implicit none
9 type test_type
10 integer :: id = 1
11 end type
13 abstract interface
14 real function fun_interface(t,x)
15 import :: test_type
16 real, intent(in) :: x
17 class(test_type) :: t
18 end function
19 end interface
21 type(test_type) :: funs
22 real :: r
23 procedure(fun_interface), pointer :: pp
25 pp => fun1 ! { dg-error "Interface mismatch in procedure pointer assignment" }
26 r = pp(funs,0.)
27 print *, " pp(0) ", r
29 contains
31 real function fun1 (t,x)
32 real, intent(in) :: x
33 type(test_type) :: t
34 print *," id = ", t%id
35 fun1 = cos(x)
36 end function
38 end