2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / bind_c_vars_driver.c
blob2af800a15c2446e5974b2dc7b02fa44d19291a58
1 double fabs (double);
3 /* defined in fortran module bind_c_vars */
4 void changeF90Globals(void);
6 extern void abort(void);
8 /* module level scope in bind_c_vars */
9 extern int myf90int; /* myf90int in bind_c_vars */
10 float myF90Real; /* f90_real in bind_c_vars */
11 int myF90Array3D[10][5][18]; /* A in bind_c_vars */
12 int myF90Array2D[2][3]; /* B in bind_c_vars */
13 int myVariable; /* c2 in bind_c_vars */
14 int c3; /* c3 in bind_c_vars */
15 int c4; /* c4 in bind_c_vars */
17 int main(int argc, char **argv)
19 myf90int = 1;
20 myF90Real = 1.0;
21 myVariable = 2;
22 c3 = 3;
23 c4 = 4;
24 myF90Array3D[2][3][4] = 1;
25 myF90Array2D[1][2] = 2;
27 /* will change the global vars initialized above */
28 changeF90Globals();
30 if(myf90int != 2)
31 abort();
32 if(fabs(myF90Real-3.0) > 0.00000000)
33 abort();
34 if(myVariable != 4)
35 abort();
36 if(c3 != 6)
37 abort();
38 if(c4 != 2)
39 abort();
40 if(myF90Array3D[2][3][4] != 2)
41 abort();
42 if(myF90Array2D[1][2] != 3)
43 abort();
45 return 0;
46 }/* end main() */