Debian Codegraph @

gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.c

raw
1 /* PR fortran/92470 - to be used with ISO_Fortran_binding_17.f90 */
2
3 #include <stdio.h>
4 #include <assert.h>
5 #include <ISO_Fortran_binding.h>
6
7 void Csub(const CFI_cdesc_t *, size_t, CFI_index_t invalid);
8
9 void Csub(const CFI_cdesc_t * dv, size_t locd, CFI_index_t invalid) {
10
11 CFI_index_t lb[1];
12 lb[0] = dv->dim[0].lower_bound;
13 size_t ld = (size_t)CFI_address(dv, lb);
14
15 if (ld != locd)
16 printf ("In C function: CFI_address of dv = %I64x\n", ld);
17 assert( ld == locd );
18
19 lb[0] = invalid;
20 /* Shall return NULL and produce stderr diagnostic with -fcheck=array. */
21 ld = (size_t)CFI_address(dv, lb);
22 assert (ld == 0);
23
24 return;
25 }