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/] [gcc.target/] [x86_64/] [abi/] [callabi/] [func-1.c] - Blame information for rev 328

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 328 jeremybenn
/* Test for cross x86_64<->w64 abi standard calls.
2
*/
3
/* Origin: Kai Tietz <kai.tietz@onevision.com> */
4
/* { dg-do run } */
5
/* { dg-options "-std=gnu99 -ffast-math" } */
6
#include "callabi.h"
7
 
8
extern void abort (void);
9
 
10
long double
11
CALLABI_CROSS func_cross (long double a, double b, float c, long d, int e,
12
                          char f)
13
{
14
  long double ret;
15
  ret = a + (long double) b + (long double) c;
16
  ret *= (long double) (d + (long) e);
17
  if (f>0)
18
    ret += func_cross (a,b,c,d,e,-f);
19
  return ret;
20
}
21
 
22
long double
23
CALLABI_NATIVE func_native (long double a, double b, float c, long d, int e,
24
                            char f)
25
{
26
  long double ret;
27
  ret = a + (long double) b + (long double) c;
28
  ret *= (long double) (d + (long) e);
29
  if (f>0)
30
    ret += func_native (a,b,c,d,e,-f);
31
  return ret;
32
}
33
 
34
int main ()
35
{
36
  if (func_cross (1.0,2.0,3.0,1,2,3)
37
      != func_native (1.0,2.0,3.0,1,2,3))
38
    abort ();
39
  return 0;
40
}

powered by: WebSVN 2.1.0

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