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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [ieee/] [inf-3.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
extern void abort (void);
2
 
3
void test(double f, double i)
4
{
5
  if (f == __builtin_huge_val())
6
    abort ();
7
  if (f == -__builtin_huge_val())
8
    abort ();
9
  if (i == -__builtin_huge_val())
10
    abort ();
11
  if (i != __builtin_huge_val())
12
    abort ();
13
 
14
  if (f >= __builtin_huge_val())
15
    abort ();
16
  if (f > __builtin_huge_val())
17
    abort ();
18
  if (i > __builtin_huge_val())
19
    abort ();
20
  if (f <= -__builtin_huge_val())
21
    abort ();
22
  if (f < -__builtin_huge_val())
23
    abort ();
24
}
25
 
26
void testf(float f, float i)
27
{
28
  if (f == __builtin_huge_valf())
29
    abort ();
30
  if (f == -__builtin_huge_valf())
31
    abort ();
32
  if (i == -__builtin_huge_valf())
33
    abort ();
34
  if (i != __builtin_huge_valf())
35
    abort ();
36
 
37
  if (f >= __builtin_huge_valf())
38
    abort ();
39
  if (f > __builtin_huge_valf())
40
    abort ();
41
  if (i > __builtin_huge_valf())
42
    abort ();
43
  if (f <= -__builtin_huge_valf())
44
    abort ();
45
  if (f < -__builtin_huge_valf())
46
    abort ();
47
}
48
 
49
void testl(long double f, long double i)
50
{
51
  if (f == __builtin_huge_vall())
52
    abort ();
53
  if (f == -__builtin_huge_vall())
54
    abort ();
55
  if (i == -__builtin_huge_vall())
56
    abort ();
57
  if (i != __builtin_huge_vall())
58
    abort ();
59
 
60
  if (f >= __builtin_huge_vall())
61
    abort ();
62
  if (f > __builtin_huge_vall())
63
    abort ();
64
  if (i > __builtin_huge_vall())
65
    abort ();
66
  if (f <= -__builtin_huge_vall())
67
    abort ();
68
  if (f < -__builtin_huge_vall())
69
    abort ();
70
}
71
 
72
int main()
73
{
74
  test (34.0, __builtin_huge_val());
75
  testf (34.0f, __builtin_huge_valf());
76
  testl (34.0l, __builtin_huge_vall());
77
  return 0;
78
}
79
 

powered by: WebSVN 2.1.0

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