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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [ieee/] [mzero5.c] - Blame information for rev 841

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

Line No. Rev Author Line
1 149 jeremybenn
/* Test gcse handling of IEEE 0/-0 rules.  */
2
static double zero = 0.0;
3
 
4
int
5
negzero_check (double d)
6
{
7
  if (d == 0)
8
    return !!memcmp ((void *)&zero, (void *)&d, sizeof (double));
9
  return 0;
10
}
11
 
12
int
13
sub (double d, double e)
14
{
15
  if (d == 0.0 && e == 0.0
16
      && negzero_check (d) == 0 && negzero_check (e) == 0)
17
    return 1;
18
  else
19
    return 0;
20
}
21
 
22
int
23
main (void)
24
{
25
  double minus_zero = -0.0;
26
  if (sub (minus_zero, 0))
27
    abort ();
28
  return 0;
29
}

powered by: WebSVN 2.1.0

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