5 void test_long_long_1d(int *array
, int num_elems
);
6 void test_long_long_2d(int *array
, int num_rows
, int num_cols
);
7 void test_long_1d(int *array
, int num_elems
);
8 void test_int_1d(int *array
, int num_elems
);
9 void test_short_1d(int *array
, int num_elems
);
10 void test_mixed(int *array
, int num_elems
);
12 int main(int argc
, char **argv
)
14 int my_array
[NUM_ELEMS
];
15 int my_2d_array
[NUM_ROWS
][NUM_COLS
];
18 for(i
= 0; i
< NUM_ELEMS
; i
++)
21 for(i
= 0; i
< NUM_ROWS
; i
++)
22 for(j
= 0; j
< NUM_COLS
; j
++)
23 my_2d_array
[i
][j
] = (i
*NUM_COLS
) + j
;
25 /* Test c_f_pointer where SHAPE is of type integer, kind=c_long_long. */
26 test_long_long_1d(my_array
, NUM_ELEMS
);
28 /* Test c_f_pointer where SHAPE is of type integer, kind=c_long_long.
29 The indices are transposed for Fortran. */
30 test_long_long_2d(my_2d_array
[0], NUM_COLS
, NUM_ROWS
);
32 /* Test c_f_pointer where SHAPE is of type integer, kind=c_long. */
33 test_long_1d(my_array
, NUM_ELEMS
);
35 /* Test c_f_pointer where SHAPE is of type integer, kind=c_int. */
36 test_int_1d(my_array
, NUM_ELEMS
);
38 /* Test c_f_pointer where SHAPE is of type integer, kind=c_short. */
39 test_short_1d(my_array
, NUM_ELEMS
);
41 /* Test c_f_pointer where SHAPE is of type integer, kind=c_int and
43 test_mixed(my_array
, NUM_ELEMS
);