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] - Rev 154

Compare with Previous | Blame | View Log

/* { dg-do run { target sparc*-*-* } } */
/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
 
extern void abort (void);
extern void exit (int);
 
int l;
 
int baz (double x)
{
  return l == 0;
}
 
double bar (double x)
{
  return 1.0;
}
 
double foo (double x)
{
  if (l == -1 || baz (x)) return x;
  if (x < 0.0)
    return bar (x);
  else
    return 0.0;
}
 
union {
  double d;
  long long l;
} x = { l: 0x7ff8000000000000LL }, y;
 
main ()
{
  unsigned int fsr = 0;
  __asm __volatile ("ld %0, %%fsr" : : "m" (fsr));
  y.d = foo (x.d);
  __asm __volatile ("st %%fsr, %0" : "=m" (fsr));
  if (x.l != y.l || (fsr & 0x3ff))
    abort ();
  exit (0);
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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