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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20020413-1.c] - Blame information for rev 301

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

Line No. Rev Author Line
1 297 jeremybenn
void test(long double val, int *eval)
2
{
3
  long double tmp = 1.0l;
4
  int i = 0;
5
 
6
  if (val < 0.0l)
7
    val = -val;
8
 
9
  if (val >= tmp)
10
    while (tmp < val)
11
      {
12
        tmp *= 2.0l;
13
        if (i++ >= 10)
14
          abort ();
15
      }
16
  else if (val != 0.0l)
17
    while (val < tmp)
18
      {
19
        tmp /= 2.0l;
20
        if (i++ >= 10)
21
          abort ();
22
      }
23
 
24
  *eval = i;
25
}
26
 
27
int main(void)
28
{
29
  int eval;
30
 
31
  test(3.0, &eval);
32
  test(3.5, &eval);
33
  test(4.0, &eval);
34
  test(5.0, &eval);
35
  exit (0);
36
}

powered by: WebSVN 2.1.0

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