Debian Codegraph @

gcc/testsuite/gfortran.dg/generic_36-2.f90

raw
1 ! { dg-do run }
2 ! { dg-compile-aux-modules "generic_36-1.f90" }
3 ! { dg-additional-sources generic_36-1.f90 }
4 ! { dg-additional-options "-O2" }
5 !
6 ! PR fortran/66973 - resolution of generic interface with TYPE(C_PTR)
7
8 PROGRAM main
9 USE H5T, only: pickone, cnt, test1, &
10 c_loc, c_ptr, c_null_ptr, &
11 c_funloc, c_funptr, c_null_funptr
12 IMPLICIT NONE
13 integer :: intval
14 REAL, TARGET :: val
15 type(c_ptr) :: ptr
16 type(c_funptr) :: funptr
17 procedure(), pointer :: indirect => null()
18 cnt = 0
19 call test1
20 cnt = 0
21 CALL pickone(intval)
22 ! print *, cnt
23 if (any (cnt /= [1,0,0])) stop 11
24 cnt = 0
25 CALL pickone(ptr)
26 CALL pickone(c_null_ptr)
27 CALL pickone(C_LOC(val))
28 ! print *, cnt
29 if (any (cnt /= [0,3,0])) stop 12
30 cnt = 0
31 CALL pickone(funptr)
32 CALL pickone(c_null_funptr)
33 CALL pickone(C_FUNLOC(indirect))
34 ! print *, cnt
35 if (any (cnt /= [0,0,3])) stop 13
36 END PROGRAM main