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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [c_by_val.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/*  Passing from fortran to C by value, using %VAL.  */
2
 
3
typedef struct { float r, i; } complex;
4
extern void f_to_f__ (float*, float, float*, float**);
5
extern void i_to_i__ (int*, int, int*, int**);
6
extern void c_to_c__ (complex*, complex, complex*, complex**);
7
extern void abort (void);
8
 
9
void
10
f_to_f__(float *retval, float a1, float *a2, float **a3)
11
{
12
  if ( a1 != *a2 ) abort();
13
  if ( a1 != **a3 ) abort();
14
  a1 = 0.0;
15
  *retval = *a2 * 2.0;
16
  return;
17
}
18
 
19
void
20
i_to_i__(int *retval, int i1, int *i2, int **i3)
21
{
22
  if ( i1 != *i2 ) abort();
23
  if ( i1 != **i3 ) abort();
24
  i1 = 0;
25
  *retval = *i2 * 3;
26
  return;
27
}
28
 
29
void
30
c_to_c__(complex *retval, complex c1, complex *c2, complex **c3)
31
{
32
  if ( c1.r != c2->r ) abort();
33
  if ( c1.i != c2->i ) abort();
34
  if ( c1.r != (*c3)->r ) abort();
35
  if ( c1.i != (*c3)->i ) abort();
36
  c1.r = 0.0;
37
  c1.i = 0.0;
38
  retval->r = c2->r * 4.0;
39
  retval->i = c2->i * 4.0;
40
  return;
41
}

powered by: WebSVN 2.1.0

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