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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [990413-2.c] - Blame information for rev 717

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

Line No. Rev Author Line
1 688 jeremybenn
/* This tests for a bug in regstack that was breaking glibc's math library. */
2
 
3
extern void abort (void);
4
 
5
static __inline double
6
minus_zero (void)
7
{
8
  union { double __d; int __i[2]; } __x;
9
  __x.__i[0] = 0x0;
10
  __x.__i[1] = 0x80000000;
11
  return __x.__d;
12
}
13
 
14
static __inline long double
15
__atan2l (long double __y, long double __x)
16
{
17
  register long double __value;
18
  __asm __volatile__ ("fpatan\n\t"
19
                      : "=t" (__value)
20
                      : "0" (__x), "u" (__y)
21
                      : "st(1)");
22
  return __value;
23
}
24
 
25
static __inline long double
26
__sqrtl (long double __x)
27
{
28
  register long double __result;
29
  __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x));
30
  return __result;
31
}
32
 
33
static __inline double
34
asin (double __x)
35
{
36
  return __atan2l (__x, __sqrtl (1.0 - __x * __x));
37
}
38
 
39
int
40
main (void)
41
{
42
  double x;
43
 
44
  x = minus_zero();
45
  x = asin (x);
46
 
47
  if (x != 0.0) /* actually -0.0, but 0.0 == -0.0 */
48
    abort ();
49
  return 0;
50
}

powered by: WebSVN 2.1.0

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