C99 testsuite readiness: Compile more tests with -std=gnu89
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / int-compare.c
blob40b78ee84afc12de494f018a8e053581ed6d0abe
1 /* { dg-additional-options "-std=gnu89" } */
3 #include <limits.h>
5 gt (a, b)
7 return a > b;
10 ge (a, b)
12 return a >= b;
15 lt (a, b)
17 return a < b;
20 le (a, b)
22 return a <= b;
25 void
26 true (c)
28 if (!c)
29 abort();
32 void
33 false (c)
35 if (c)
36 abort();
39 f ()
41 true (gt (2, 1));
42 false (gt (1, 2));
44 true (gt (INT_MAX, 0));
45 false (gt (0, INT_MAX));
46 true (gt (INT_MAX, 1));
47 false (gt (1, INT_MAX));
49 false (gt (INT_MIN, 0));
50 true (gt (0, INT_MIN));
51 false (gt (INT_MIN, 1));
52 true (gt (1, INT_MIN));
54 true (gt (INT_MAX, INT_MIN));
55 false (gt (INT_MIN, INT_MAX));
57 true (ge (2, 1));
58 false (ge (1, 2));
60 true (ge (INT_MAX, 0));
61 false (ge (0, INT_MAX));
62 true (ge (INT_MAX, 1));
63 false (ge (1, INT_MAX));
65 false (ge (INT_MIN, 0));
66 true (ge (0, INT_MIN));
67 false (ge (INT_MIN, 1));
68 true (ge (1, INT_MIN));
70 true (ge (INT_MAX, INT_MIN));
71 false (ge (INT_MIN, INT_MAX));
73 false (lt (2, 1));
74 true (lt (1, 2));
76 false (lt (INT_MAX, 0));
77 true (lt (0, INT_MAX));
78 false (lt (INT_MAX, 1));
79 true (lt (1, INT_MAX));
81 true (lt (INT_MIN, 0));
82 false (lt (0, INT_MIN));
83 true (lt (INT_MIN, 1));
84 false (lt (1, INT_MIN));
86 false (lt (INT_MAX, INT_MIN));
87 true (lt (INT_MIN, INT_MAX));
89 false (le (2, 1));
90 true (le (1, 2));
92 false (le (INT_MAX, 0));
93 true (le (0, INT_MAX));
94 false (le (INT_MAX, 1));
95 true (le (1, INT_MAX));
97 true (le (INT_MIN, 0));
98 false (le (0, INT_MIN));
99 true (le (INT_MIN, 1));
100 false (le (1, INT_MIN));
102 false (le (INT_MAX, INT_MIN));
103 true (le (INT_MIN, INT_MAX));
106 main ()
108 f ();
109 exit (0);