modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / ISO_Fortran_binding_18.c
blob5a3952ca92e2411d05c3e4e9d9c368bd1a169524
1 #include <stdlib.h>
2 #include <string.h>
3 #include <ISO_Fortran_binding.h>
6 extern int do_loop(CFI_cdesc_t* array);
8 int main(int argc, char ** argv)
10 int nx = 9;
11 int ny = 10;
12 int nz = 2;
14 int arr[nx*ny*nz];
15 memset(arr,0,sizeof(int)*nx*ny*nz);
16 CFI_index_t shape[3];
17 shape[0] = nz;
18 shape[1] = ny;
19 shape[2] = nx;
21 CFI_CDESC_T(3) farr;
22 int rc = CFI_establish((CFI_cdesc_t*)&farr, arr, CFI_attribute_other, CFI_type_int, 0, (CFI_rank_t)3, (const CFI_index_t *)shape);
23 if (rc != CFI_SUCCESS) abort();
24 int result = do_loop((CFI_cdesc_t*)&farr);
25 if (result != nx*ny*nz) abort();
26 return 0;