diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/proc_ptr_8.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/proc_ptr_8.f90 | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_8.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_8.f90 new file mode 100644 index 00000000000..80d26619bc0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_8.f90 @@ -0,0 +1,34 @@ +! { dg-do run } +! { dg-additional-sources proc_ptr_8.c } +! +! PR fortran/32580 +! Original test case +! +! Contributed by Joost VandeVondele <jv244@cam.ac.uk> + +MODULE X + + USE ISO_C_BINDING + INTERFACE + INTEGER(KIND=C_INT) FUNCTION mytype( a ) BIND(C) + USE ISO_C_BINDING + INTEGER(KIND=C_INT), VALUE :: a + END FUNCTION + SUBROUTINE init() BIND(C,name="init") + END SUBROUTINE + END INTERFACE + + TYPE(C_FUNPTR), BIND(C,name="funpointer") :: funpointer + +END MODULE X + +USE X +PROCEDURE(mytype), POINTER :: ptype + +CALL init() +CALL C_F_PROCPOINTER(funpointer,ptype) +if (ptype(3) /= 9) call abort() + +END + +! { dg-final { cleanup-modules "X" } } |