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/] [inf-2.c] - Blame information for rev 816

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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