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/] [int-compare.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
#include <limits.h>
2
 
3
gt (a, b)
4
{
5
  return a > b;
6
}
7
 
8
ge (a, b)
9
{
10
  return a >= b;
11
}
12
 
13
lt (a, b)
14
{
15
  return a < b;
16
}
17
 
18
le (a, b)
19
{
20
  return a <= b;
21
}
22
 
23
void
24
true (c)
25
{
26
  if (!c)
27
    abort();
28
}
29
 
30
void
31
false (c)
32
{
33
  if (c)
34
    abort();
35
}
36
 
37
f ()
38
{
39
  true (gt (2, 1));
40
  false (gt (1, 2));
41
 
42
  true (gt (INT_MAX, 0));
43
  false (gt (0, INT_MAX));
44
  true (gt (INT_MAX, 1));
45
  false (gt (1, INT_MAX));
46
 
47
  false (gt (INT_MIN, 0));
48
  true (gt (0, INT_MIN));
49
  false (gt (INT_MIN, 1));
50
  true (gt (1, INT_MIN));
51
 
52
  true (gt (INT_MAX, INT_MIN));
53
  false (gt (INT_MIN, INT_MAX));
54
 
55
  true (ge (2, 1));
56
  false (ge (1, 2));
57
 
58
  true (ge (INT_MAX, 0));
59
  false (ge (0, INT_MAX));
60
  true (ge (INT_MAX, 1));
61
  false (ge (1, INT_MAX));
62
 
63
  false (ge (INT_MIN, 0));
64
  true (ge (0, INT_MIN));
65
  false (ge (INT_MIN, 1));
66
  true (ge (1, INT_MIN));
67
 
68
  true (ge (INT_MAX, INT_MIN));
69
  false (ge (INT_MIN, INT_MAX));
70
 
71
  false (lt (2, 1));
72
  true (lt (1, 2));
73
 
74
  false (lt (INT_MAX, 0));
75
  true (lt (0, INT_MAX));
76
  false (lt (INT_MAX, 1));
77
  true (lt (1, INT_MAX));
78
 
79
  true (lt (INT_MIN, 0));
80
  false (lt (0, INT_MIN));
81
  true (lt (INT_MIN, 1));
82
  false (lt (1, INT_MIN));
83
 
84
  false (lt (INT_MAX, INT_MIN));
85
  true (lt (INT_MIN, INT_MAX));
86
 
87
  false (le (2, 1));
88
  true (le (1, 2));
89
 
90
  false (le (INT_MAX, 0));
91
  true (le (0, INT_MAX));
92
  false (le (INT_MAX, 1));
93
  true (le (1, INT_MAX));
94
 
95
  true (le (INT_MIN, 0));
96
  false (le (0, INT_MIN));
97
  true (le (INT_MIN, 1));
98
  false (le (1, INT_MIN));
99
 
100
  false (le (INT_MAX, INT_MIN));
101
  true (le (INT_MIN, INT_MAX));
102
}
103
 
104
main ()
105
{
106
  f ();
107
  exit (0);
108
}

powered by: WebSVN 2.1.0

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