URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 338 |
/* Copyright (C) 2003 Free Software Foundation.
|
/* Copyright (C) 2003 Free Software Foundation.
|
|
|
Check that the RTL expansion of floating point exponentiation by
|
Check that the RTL expansion of floating point exponentiation by
|
a constant integer doesn't break anything and produces the expected
|
a constant integer doesn't break anything and produces the expected
|
results.
|
results.
|
|
|
Written by Roger Sayle, 20th June 2003. */
|
Written by Roger Sayle, 20th June 2003. */
|
|
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-O2 -ffast-math" } */
|
/* { dg-options "-O2 -ffast-math" } */
|
|
|
extern double pow(double,double);
|
extern double pow(double,double);
|
extern void abort(void);
|
extern void abort(void);
|
|
|
double foo (double x)
|
double foo (double x)
|
{
|
{
|
return pow (x, 6);
|
return pow (x, 6);
|
}
|
}
|
|
|
double bar (double x)
|
double bar (double x)
|
{
|
{
|
return pow (x, -4);
|
return pow (x, -4);
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
if (foo (2.0) != 64.0)
|
if (foo (2.0) != 64.0)
|
abort ();
|
abort ();
|
|
|
if (bar (2.0) != 0.0625)
|
if (bar (2.0) != 0.0625)
|
abort ();
|
abort ();
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.