URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 384 |
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */
|
/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */
|
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */
|
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */
|
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details" { target *-*-netware* } } */
|
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details" { target *-*-netware* } } */
|
/* { dg-final { scan-tree-dump "cdce2.c:17: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
|
/* { dg-final { scan-tree-dump "cdce2.c:17: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
|
/* { dg-final { cleanup-tree-dump "cdce" } } */
|
/* { dg-final { cleanup-tree-dump "cdce" } } */
|
|
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#include <math.h>
|
#include <math.h>
|
#include <errno.h>
|
#include <errno.h>
|
int total_err_count = 0;
|
int total_err_count = 0;
|
double foo_opt (double y) __attribute__((noinline));
|
double foo_opt (double y) __attribute__((noinline));
|
double foo_opt (double y)
|
double foo_opt (double y)
|
{
|
{
|
double yy = 0;
|
double yy = 0;
|
errno = 0;
|
errno = 0;
|
yy = log (y);
|
yy = log (y);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
double foo (double y) __attribute__((noinline));
|
double foo (double y) __attribute__((noinline));
|
double foo (double y)
|
double foo (double y)
|
{
|
{
|
double yy = 0;
|
double yy = 0;
|
errno = 0;
|
errno = 0;
|
yy = log (y);
|
yy = log (y);
|
return yy;
|
return yy;
|
}
|
}
|
|
|
int test (double (*fp) (double y))
|
int test (double (*fp) (double y))
|
{
|
{
|
int i,x;
|
int i,x;
|
for (i = -100; i < 100; i++)
|
for (i = -100; i < 100; i++)
|
{
|
{
|
fp (i);
|
fp (i);
|
if (errno)
|
if (errno)
|
total_err_count ++;
|
total_err_count ++;
|
}
|
}
|
|
|
return total_err_count;
|
return total_err_count;
|
}
|
}
|
|
|
int main ()
|
int main ()
|
{
|
{
|
int en1, en2;
|
int en1, en2;
|
double yy;
|
double yy;
|
total_err_count = 0;
|
total_err_count = 0;
|
en1 = test (foo_opt);
|
en1 = test (foo_opt);
|
total_err_count = 0;
|
total_err_count = 0;
|
en2 = test (foo);
|
en2 = test (foo);
|
|
|
if (en1 != en2)
|
if (en1 != en2)
|
abort();
|
abort();
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.