Debian Codegraph @

gcc/testsuite/gfortran.dg/ISO_Fortran_binding_16.f90

raw
1 ! { dg-do run }
2 ! { dg-additional-options "-fbounds-check" }
3 ! { dg-additional-sources ISO_Fortran_binding_16.c }
4 !
5 ! Test the fix for PR92142.
6 !
7 use, intrinsic :: iso_c_binding, only: c_int
8
9 implicit none
10
11 interface
12 function c_setpointer(ip) result(ierr) bind(c)
13 use, intrinsic :: iso_c_binding, only: c_int
14 type(*), dimension(..), target :: ip
15 integer(c_int) :: ierr
16 end function c_setpointer
17 end interface
18
19 integer(c_int) :: it = 1
20
21 if (c_setpointer(it) /= 0) stop 1
22
23 end
24
25 ! { dg-output "CFI_setpointer: Result shall be the address of a C descriptor for a Fortran pointer." }