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-2.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
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
#ifndef __SPU__
29
  /* The SPU single-precision floating point format does not support Inf.  */
30
 
31
  if (f == __builtin_inff())
32
    abort ();
33
  if (f == -__builtin_inff())
34
    abort ();
35
  if (i == -__builtin_inff())
36
    abort ();
37
  if (i != __builtin_inff())
38
    abort ();
39
 
40
  if (f >= __builtin_inff())
41
    abort ();
42
  if (f > __builtin_inff())
43
    abort ();
44
  if (i > __builtin_inff())
45
    abort ();
46
  if (f <= -__builtin_inff())
47
    abort ();
48
  if (f < -__builtin_inff())
49
    abort ();
50
#endif
51
}
52
 
53
void testl(long double f, long double i)
54
{
55
  if (f == __builtin_infl())
56
    abort ();
57
  if (f == -__builtin_infl())
58
    abort ();
59
  if (i == -__builtin_infl())
60
    abort ();
61
  if (i != __builtin_infl())
62
    abort ();
63
 
64
  if (f >= __builtin_infl())
65
    abort ();
66
  if (f > __builtin_infl())
67
    abort ();
68
  if (i > __builtin_infl())
69
    abort ();
70
  if (f <= -__builtin_infl())
71
    abort ();
72
  if (f < -__builtin_infl())
73
    abort ();
74
}
75
 
76
int main()
77
{
78
  test (34.0, __builtin_inf());
79
  testf (34.0f, __builtin_inff());
80
  testl (34.0l, __builtin_infl());
81
  return 0;
82
}
83
 

powered by: WebSVN 2.1.0

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