tunsignedcomp.nim 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. discard """
  2. output: ''''''
  3. disabled: "true"
  4. """
  5. # All operations involving uint64 are commented out
  6. # as they're not yet supported.
  7. # All other operations are handled by implicit conversions from uints to ints
  8. # uint64 could be supported but would need special implementation of the operators
  9. # unsigned < signed
  10. doAssert 10'u8 < 20'i8
  11. doAssert 10'u8 < 20'i16
  12. doAssert 10'u8 < 20'i32
  13. doAssert 10'u8 < 20'i64
  14. doAssert 10'u16 < 20'i8
  15. doAssert 10'u16 < 20'i16
  16. doAssert 10'u16 < 20'i32
  17. doAssert 10'u16 < 20'i64
  18. doAssert 10'u32 < 20'i8
  19. doAssert 10'u32 < 20'i16
  20. doAssert 10'u32 < 20'i32
  21. doAssert 10'u32 < 20'i64
  22. # doAssert 10'u64 < 20'i8
  23. # doAssert 10'u64 < 20'i16
  24. # doAssert 10'u64 < 20'i32
  25. # doAssert 10'u64 < 20'i64
  26. # signed < unsigned
  27. doAssert 10'i8 < 20'u8
  28. doAssert 10'i8 < 20'u16
  29. doAssert 10'i8 < 20'u32
  30. # doAssert 10'i8 < 20'u64
  31. doAssert 10'i16 < 20'u8
  32. doAssert 10'i16 < 20'u16
  33. doAssert 10'i16 < 20'u32
  34. # doAssert 10'i16 < 20'u64
  35. doAssert 10'i32 < 20'u8
  36. doAssert 10'i32 < 20'u16
  37. doAssert 10'i32 < 20'u32
  38. # doAssert 10'i32 < 20'u64
  39. doAssert 10'i64 < 20'u8
  40. doAssert 10'i64 < 20'u16
  41. doAssert 10'i64 < 20'u32
  42. # doAssert 10'i64 < 20'u64
  43. # unsigned <= signed
  44. doAssert 10'u8 <= 20'i8
  45. doAssert 10'u8 <= 20'i16
  46. doAssert 10'u8 <= 20'i32
  47. doAssert 10'u8 <= 20'i64
  48. doAssert 10'u16 <= 20'i8
  49. doAssert 10'u16 <= 20'i16
  50. doAssert 10'u16 <= 20'i32
  51. doAssert 10'u16 <= 20'i64
  52. doAssert 10'u32 <= 20'i8
  53. doAssert 10'u32 <= 20'i16
  54. doAssert 10'u32 <= 20'i32
  55. doAssert 10'u32 <= 20'i64
  56. # doAssert 10'u64 <= 20'i8
  57. # doAssert 10'u64 <= 20'i16
  58. # doAssert 10'u64 <= 20'i32
  59. # doAssert 10'u64 <= 20'i64
  60. # signed <= unsigned
  61. doAssert 10'i8 <= 20'u8
  62. doAssert 10'i8 <= 20'u16
  63. doAssert 10'i8 <= 20'u32
  64. # doAssert 10'i8 <= 20'u64
  65. doAssert 10'i16 <= 20'u8
  66. doAssert 10'i16 <= 20'u16
  67. doAssert 10'i16 <= 20'u32
  68. # doAssert 10'i16 <= 20'u64
  69. doAssert 10'i32 <= 20'u8
  70. doAssert 10'i32 <= 20'u16
  71. doAssert 10'i32 <= 20'u32
  72. # doAssert 10'i32 <= 20'u64
  73. doAssert 10'i64 <= 20'u8
  74. doAssert 10'i64 <= 20'u16
  75. doAssert 10'i64 <= 20'u32
  76. # doAssert 10'i64 <= 20'u64
  77. # signed == unsigned
  78. doAssert 10'i8 == 10'u8
  79. doAssert 10'i8 == 10'u16
  80. doAssert 10'i8 == 10'u32
  81. # doAssert 10'i8 == 10'u64
  82. doAssert 10'i16 == 10'u8
  83. doAssert 10'i16 == 10'u16
  84. doAssert 10'i16 == 10'u32
  85. # doAssert 10'i16 == 10'u64
  86. doAssert 10'i32 == 10'u8
  87. doAssert 10'i32 == 10'u16
  88. doAssert 10'i32 == 10'u32
  89. # doAssert 10'i32 == 10'u64
  90. doAssert 10'i64 == 10'u8
  91. doAssert 10'i64 == 10'u16
  92. doAssert 10'i64 == 10'u32
  93. # doAssert 10'i64 == 10'u64
  94. # unsigned == signed
  95. doAssert 10'u8 == 10'i8
  96. doAssert 10'u8 == 10'i16
  97. doAssert 10'u8 == 10'i32
  98. # doAssert 10'u8 == 10'i64
  99. doAssert 10'u16 == 10'i8
  100. doAssert 10'u16 == 10'i16
  101. doAssert 10'u16 == 10'i32
  102. # doAssert 10'u16 == 10'i64
  103. doAssert 10'u32 == 10'i8
  104. doAssert 10'u32 == 10'i16
  105. doAssert 10'u32 == 10'i32
  106. # doAssert 10'u32 == 10'i64
  107. # doAssert 10'u64 == 10'i8
  108. # doAssert 10'u64 == 10'i16
  109. # doAssert 10'u64 == 10'i32
  110. # doAssert 10'u64 == 10'i64