[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / c_f_pointer_shape_tests_2_driver.c
blob1282beb12d7e7794eea476be5891784b7006af47
1 #define NUM_ELEMS 10
2 #define NUM_ROWS 2
3 #define NUM_COLS 3
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];
16 int i, j;
18 for(i = 0; i < NUM_ELEMS; i++)
19 my_array[i] = 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
42 kind=c_long_long. */
43 test_mixed(my_array, NUM_ELEMS);
45 return 0;