OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [bind_c_vars_driver.c] - Blame information for rev 308

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
double fabs (double);
2
 
3
/* defined in fortran module bind_c_vars */
4
void changeF90Globals(void);
5
 
6
extern void abort(void);
7
 
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 */
16
 
17
int main(int argc, char **argv)
18
{
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;
26
 
27
   /* will change the global vars initialized above */
28
   changeF90Globals();
29
 
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();
44
 
45
   return 0;
46
}/* end main() */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.