Debian Codegraph @

gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90

raw
1 ! PR 101317
2 ! { dg-do run }
3 ! { dg-additional-sources "setpointer-errors-c.c dump-descriptors.c" }
4 ! { dg-additional-options "-Wno-error -fcheck=all" }
5 ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
6 !
7 ! This program tests that the CFI_setpointer function properly detects
8 ! invalid arguments. All the interesting things happen in the
9 ! corresponding C code.
10 !
11 ! The situation here seems to be that while TS29113 defines error codes for
12 ! CFI_setpointer, it doesn't actually require the implementation to detect
13 ! those errors by saying the arguments "shall be" such-and-such, e.g. it is
14 ! undefined behavior if they are not. In gfortran you can enable some
15 ! run-time checking by building with -fcheck=all.
16
17 program testit
18 use iso_c_binding
19 implicit none
20
21 interface
22 subroutine ctest () bind (c)
23 end subroutine
24 end interface
25
26 call ctest ()
27
28 end program