Debian Codegraph @

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

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