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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [20001013-1.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do run { target sparc*-*-* } } */
2
/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
3
 
4
extern void abort (void);
5
extern void exit (int);
6
 
7
int l;
8
 
9
int baz (double x)
10
{
11
  return l == 0;
12
}
13
 
14
double bar (double x)
15
{
16
  return 1.0;
17
}
18
 
19
double foo (double x)
20
{
21
  if (l == -1 || baz (x)) return x;
22
  if (x < 0.0)
23
    return bar (x);
24
  else
25
    return 0.0;
26
}
27
 
28
union {
29
  double d;
30
  long long l;
31
} x = { l: 0x7ff8000000000000LL }, y;
32
 
33
main ()
34
{
35
  unsigned int fsr = 0;
36
  __asm __volatile ("ld %0, %%fsr" : : "m" (fsr));
37
  y.d = foo (x.d);
38
  __asm __volatile ("st %%fsr, %0" : "=m" (fsr));
39
  if (x.l != y.l || (fsr & 0x3ff))
40
    abort ();
41
  exit (0);
42
}

powered by: WebSVN 2.1.0

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