OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [c_loc_tests_2_funcs.c] - Blame information for rev 437

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

Line No. Rev Author Line
1 302 jeremybenn
double fabs (double);
2
 
3
typedef struct ctype
4
{
5
  int i;
6
  double x;
7
}ctype_t;
8
 
9
int test_scalar_address(int *ptr)
10
{
11
  /* The value in Fortran should be initialized to 100. */
12
  if(*ptr != 100)
13
    return 0;
14
  else
15
    return 1;
16
}
17
 
18
int test_array_address(int *int_array, int num_elements)
19
{
20
  int i = 0;
21
 
22
  for(i = 0; i < num_elements; i++)
23
    /* Fortran will init all of the elements to 100; verify that here. */
24
    if(int_array[i] != 100)
25
      return 0;
26
 
27
  /* all elements were equal to 100 */
28
  return 1;
29
}
30
 
31
int test_type_address(ctype_t *type_ptr)
32
{
33
  /* i was set to 100 by Fortran */
34
  if(type_ptr->i != 100)
35
    return 0;
36
 
37
  /* x was set to 1.0d0 by Fortran */
38
  if(fabs(type_ptr->x - 1.0) > 0.00000000)
39
    return 0;
40
 
41
  return 1;
42
}

powered by: WebSVN 2.1.0

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