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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [bind_c_coms_driver.c] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
double fabs(double);
2
 
3
void test_coms(void);
4
 
5
extern void abort(void);
6
 
7
struct {double r, s; } com;     /* refers to the common block "com" */
8
double single;                  /* refers to the common block "single" */
9
long int mycom;                 /* refers to the common block "MYCOM" */
10
long long int mycom2;           /* refers to the common block "MYCOM2" */
11
struct {int i, j; } f03_com2;   /* refers to the common block "com2" */
12
 
13
int main(int argc, char **argv)
14
{
15
  com.r = 1.0;
16
  com.s = 2.0;
17
  single = 1.0;
18
  mycom = 1;
19
  mycom2 = 2;
20
  f03_com2.i = 1;
21
  f03_com2.j = 2;
22
 
23
  /* change the common block variables in F90 */
24
  test_coms();
25
 
26
  if(fabs(com.r - 1.1) > 0.00000000)
27
    abort();
28
  if(fabs(com.s - 2.1) > 0.00000000)
29
    abort();
30
  if(fabs(single - 1.1) > 0.00000000)
31
    abort();
32
  if(mycom != 2)
33
    abort();
34
  if(mycom2 != 3)
35
    abort();
36
  if(f03_com2.i != 2)
37
    abort();
38
  if(f03_com2.j != 3)
39
    abort();
40
 
41
  return 0;
42
}/* end main() */

powered by: WebSVN 2.1.0

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