1 #include "../../../libgfortran/ISO_Fortran_binding.h" 2 #include <stdio.h> 3 #include <stdlib.h> 4 5 /* Part of the test for the fix of PR88929 - see ISO_Fortran_binding_3.f90. */ 6 c_test(CFI_cdesc_t * a_desc)7int c_test (CFI_cdesc_t * a_desc) 8 { 9 CFI_index_t idx[2]; 10 int *res_addr; 11 int err = 1; /* this error code represents all errors */ 12 13 if (a_desc->rank != 2) 14 return err; 15 16 if (a_desc->type != CFI_type_int) 17 return err; 18 19 err = 0; 20 for (idx[0] = 0; idx[0] < a_desc->dim[0].extent; idx[0]++) 21 for (idx[1] = 0; idx[1] < a_desc->dim[1].extent; idx[1]++) 22 { 23 res_addr = CFI_address (a_desc, idx); 24 err += *res_addr; 25 *res_addr = *res_addr + 1; 26 } 27 28 if (err != 10) return 1; 29 30 return 0; 31 } 32 33