1 /* Test the fix for PR94331. */
7 #include <ISO_Fortran_binding.h>
9 bool c_vrfy (const CFI_cdesc_t
*restrict
);
11 bool check_bounds(const CFI_cdesc_t
*restrict
, const int, const int);
14 c_vrfy (const CFI_cdesc_t
*restrict auxp
)
16 CFI_index_t i
, lb
, ub
, ex
;
20 assert (auxp
->base_addr
);
21 lb
= auxp
->dim
[0].lower_bound
;
22 ex
= auxp
->dim
[0].extent
;
24 ip
= (int*)auxp
->base_addr
;
28 for (i
=lb
; i
<ub
+1; i
++)
30 ip
= (int*)CFI_address(auxp
, &i
);
38 check_bounds (const CFI_cdesc_t
*restrict auxp
, const int lb
, const int ub
)
40 CFI_index_t ex
= ub
-lb
+1;
46 assert (auxp
->rank
==1);
47 assert (auxp
->type
==CFI_type_int
);
48 assert (auxp
->dim
[0].sm
>0);
49 assert ((size_t)auxp
->dim
[0].sm
==el
);
50 if (auxp
->dim
[0].extent
==ex
51 && auxp
->dim
[0].lower_bound
==lb
)
53 switch(auxp
->attribute
)
55 case CFI_attribute_pointer
:
56 case CFI_attribute_allocatable
:
61 case CFI_attribute_other
: