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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr42691.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 688 jeremybenn
extern void abort (void);
2
 
3
union _D_rep
4
{
5
  unsigned short rep[4];
6
  double val;
7
};
8
 
9
int add(double* key, double* table)
10
{
11
  unsigned i = 0;
12
  double* deletedEntry = 0;
13
  while (1) {
14
    double* entry = table + i;
15
 
16
    if (*entry == *key)
17
      break;
18
 
19
    union _D_rep _D_inf = {{ 0, 0, 0, 0x7ff0 }};
20
    if (*entry != _D_inf.val)
21
      abort ();
22
 
23
    union _D_rep _D_inf2 = {{ 0, 0, 0, 0x7ff0 }};
24
    if (!_D_inf2.val)
25
      deletedEntry = entry;
26
 
27
    i++;
28
  }
29
  if (deletedEntry)
30
    *deletedEntry = 0.0;
31
  return 0;
32
}
33
 
34
int main ()
35
{
36
  union _D_rep infinit = {{ 0, 0, 0, 0x7ff0 }};
37
  double table[2] = { infinit.val, 23 };
38
  double key = 23;
39
  int ret = add (&key, table);
40
  return ret;
41
}

powered by: WebSVN 2.1.0

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