2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / bind_c_dts_2_driver.c
blob53d26794e3f62a006c2fb47ac5679ffa38fa59eb
1 typedef struct c_type_0
3 int i;
4 int *ptr;
5 int array[3];
6 }c_type_0_t;
8 typedef struct c_type_1
10 c_type_0_t nested_type;
11 int *ptr;
12 int j;
13 }c_type_1_t;
15 void sub0(c_type_1_t *c_type, int expected_i, int *expected_nested_ptr,
16 int array_0, int array_1, int array_2,
17 int *expected_ptr, int expected_j);
19 int main(int argc, char **argv)
21 c_type_1_t c_type;
23 c_type.nested_type.i = 10;
24 c_type.nested_type.ptr = &(c_type.nested_type.i);
25 c_type.nested_type.array[0] = 1;
26 c_type.nested_type.array[1] = 2;
27 c_type.nested_type.array[2] = 3;
28 c_type.ptr = &(c_type.j);
29 c_type.j = 11;
31 sub0(&c_type, c_type.nested_type.i, c_type.nested_type.ptr,
32 c_type.nested_type.array[0],
33 c_type.nested_type.array[1], c_type.nested_type.array[2],
34 c_type.ptr, c_type.j);
36 return 0;