7s-unsigned-compare.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /* -*-comment-start: "//";comment-end:""-*-
  2. * GNU Mes --- Maxwell Equations of Software
  3. * Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  4. *
  5. * This file is part of GNU Mes.
  6. *
  7. * GNU Mes is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * GNU Mes is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include <limits.h>
  21. int
  22. main ()
  23. {
  24. {
  25. int i = 0;
  26. if (i < -1)
  27. return 1;
  28. }
  29. {
  30. unsigned u = 0;
  31. if (-1 < u)
  32. return 2;
  33. }
  34. {
  35. int i = INT_MAX + 2;
  36. if (INT_MAX < i)
  37. return 3;
  38. }
  39. {
  40. unsigned u = INT_MAX + 2;
  41. if (u < INT_MAX)
  42. return 4;
  43. }
  44. {
  45. int i = -1;
  46. if (-1 > 0)
  47. return 5;
  48. }
  49. {
  50. unsigned u = INT_MAX + 2;
  51. if (INT_MAX > u)
  52. return 6;
  53. }
  54. {
  55. int i = INT_MAX + 2;
  56. if (i > 0)
  57. return 7;
  58. }
  59. {
  60. unsigned u = 0;
  61. if (u > -1)
  62. return 8;
  63. }
  64. {
  65. int i = 0;
  66. if (i <= -1)
  67. return 9;
  68. }
  69. {
  70. unsigned u = 0;
  71. if (-1 <= u)
  72. return 10;
  73. }
  74. {
  75. int i = INT_MAX + 2;
  76. if (INT_MAX <= i)
  77. return 11;
  78. }
  79. {
  80. unsigned u = INT_MAX + 2;
  81. if (u <= INT_MAX)
  82. return 12;
  83. }
  84. {
  85. int i = -1;
  86. if (-1 >= 0)
  87. return 13;
  88. }
  89. {
  90. unsigned u = INT_MAX + 2;
  91. if (INT_MAX >= u)
  92. return 14;
  93. }
  94. {
  95. int i = INT_MAX + 2;
  96. if (i >= 0)
  97. return 15;
  98. }
  99. {
  100. unsigned u = 0;
  101. if (u >= -1)
  102. return 16;
  103. }
  104. return 0;
  105. }