(root)/
gcc-13.2.0/
gcc/
testsuite/
gfortran.dg/
bind_c_array_params_3_aux.c
       1  /* Used by bind_c_array_params_3.f90.  */
       2  /* PR fortran/92284.  */
       3  
       4  #include <assert.h>
       5  #include <errno.h>
       6  #include <stdio.h>
       7  
       8  #include <ISO_Fortran_binding.h>
       9  
      10  void arr_set_c(CFI_cdesc_t*);
      11  
      12  void arr_set_c(CFI_cdesc_t *arr){
      13    int i, stat, *auxp = NULL;
      14    CFI_index_t   lb[] = {1};
      15    CFI_index_t   ub[] = {9};
      16    
      17    assert(arr);
      18    assert(arr->rank==1);
      19    assert(!arr->base_addr);
      20    stat = CFI_allocate(arr, lb, ub, sizeof(int));
      21    assert(stat==CFI_SUCCESS);
      22    auxp = (int*)arr->base_addr;
      23    assert(auxp);
      24    for(i=0; i<ub[0]-lb[0]+1; i++) auxp[i]=i;
      25    return;
      26  }