arm: Add .type and .size to __gnu_cmse_nonsecure_call [PR115360]
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_25.f90
blobf553810695d390bd0ddd1922282a941c63a219a4
1 ! { dg-do run }
3 ! PR 41139: [4.5 Regression] a procedure pointer call as actual argument
5 ! Original test case by Barron Bichon <barron.bichon@swri.org>
6 ! Modified by Janus Weil <janus@gcc.gnu.org>
8 PROGRAM test
10 PROCEDURE(add), POINTER :: f
11 logical :: g
13 ! Passing the function works
14 g=greater(4.,add(1.,2.))
15 if (.not. g) STOP 1
17 ! Passing the procedure pointer fails
18 f => add
19 g=greater(4.,f(1.,2.))
20 if (.not. g) STOP 2
22 CONTAINS
24 REAL FUNCTION add(x,y)
25 REAL, INTENT(in) :: x,y
26 print *,"add:",x,y
27 add = x+y
28 END FUNCTION add
30 LOGICAL FUNCTION greater(x,y)
31 REAL, INTENT(in) :: x, y
32 greater = (x > y)
33 END FUNCTION greater
35 END PROGRAM test