tunsignedcomp.nim 2.7 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. assert 10'u8 < 20'i8
  11. assert 10'u8 < 20'i16
  12. assert 10'u8 < 20'i32
  13. assert 10'u8 < 20'i64
  14. assert 10'u16 < 20'i8
  15. assert 10'u16 < 20'i16
  16. assert 10'u16 < 20'i32
  17. assert 10'u16 < 20'i64
  18. assert 10'u32 < 20'i8
  19. assert 10'u32 < 20'i16
  20. assert 10'u32 < 20'i32
  21. assert 10'u32 < 20'i64
  22. # assert 10'u64 < 20'i8
  23. # assert 10'u64 < 20'i16
  24. # assert 10'u64 < 20'i32
  25. # assert 10'u64 < 20'i64
  26. # signed < unsigned
  27. assert 10'i8 < 20'u8
  28. assert 10'i8 < 20'u16
  29. assert 10'i8 < 20'u32
  30. # assert 10'i8 < 20'u64
  31. assert 10'i16 < 20'u8
  32. assert 10'i16 < 20'u16
  33. assert 10'i16 < 20'u32
  34. # assert 10'i16 < 20'u64
  35. assert 10'i32 < 20'u8
  36. assert 10'i32 < 20'u16
  37. assert 10'i32 < 20'u32
  38. # assert 10'i32 < 20'u64
  39. assert 10'i64 < 20'u8
  40. assert 10'i64 < 20'u16
  41. assert 10'i64 < 20'u32
  42. # assert 10'i64 < 20'u64
  43. # unsigned <= signed
  44. assert 10'u8 <= 20'i8
  45. assert 10'u8 <= 20'i16
  46. assert 10'u8 <= 20'i32
  47. assert 10'u8 <= 20'i64
  48. assert 10'u16 <= 20'i8
  49. assert 10'u16 <= 20'i16
  50. assert 10'u16 <= 20'i32
  51. assert 10'u16 <= 20'i64
  52. assert 10'u32 <= 20'i8
  53. assert 10'u32 <= 20'i16
  54. assert 10'u32 <= 20'i32
  55. assert 10'u32 <= 20'i64
  56. # assert 10'u64 <= 20'i8
  57. # assert 10'u64 <= 20'i16
  58. # assert 10'u64 <= 20'i32
  59. # assert 10'u64 <= 20'i64
  60. # signed <= unsigned
  61. assert 10'i8 <= 20'u8
  62. assert 10'i8 <= 20'u16
  63. assert 10'i8 <= 20'u32
  64. # assert 10'i8 <= 20'u64
  65. assert 10'i16 <= 20'u8
  66. assert 10'i16 <= 20'u16
  67. assert 10'i16 <= 20'u32
  68. # assert 10'i16 <= 20'u64
  69. assert 10'i32 <= 20'u8
  70. assert 10'i32 <= 20'u16
  71. assert 10'i32 <= 20'u32
  72. # assert 10'i32 <= 20'u64
  73. assert 10'i64 <= 20'u8
  74. assert 10'i64 <= 20'u16
  75. assert 10'i64 <= 20'u32
  76. # assert 10'i64 <= 20'u64
  77. # signed == unsigned
  78. assert 10'i8 == 10'u8
  79. assert 10'i8 == 10'u16
  80. assert 10'i8 == 10'u32
  81. # assert 10'i8 == 10'u64
  82. assert 10'i16 == 10'u8
  83. assert 10'i16 == 10'u16
  84. assert 10'i16 == 10'u32
  85. # assert 10'i16 == 10'u64
  86. assert 10'i32 == 10'u8
  87. assert 10'i32 == 10'u16
  88. assert 10'i32 == 10'u32
  89. # assert 10'i32 == 10'u64
  90. assert 10'i64 == 10'u8
  91. assert 10'i64 == 10'u16
  92. assert 10'i64 == 10'u32
  93. # assert 10'i64 == 10'u64
  94. # unsigned == signed
  95. assert 10'u8 == 10'i8
  96. assert 10'u8 == 10'i16
  97. assert 10'u8 == 10'i32
  98. # assert 10'u8 == 10'i64
  99. assert 10'u16 == 10'i8
  100. assert 10'u16 == 10'i16
  101. assert 10'u16 == 10'i32
  102. # assert 10'u16 == 10'i64
  103. assert 10'u32 == 10'i8
  104. assert 10'u32 == 10'i16
  105. assert 10'u32 == 10'i32
  106. # assert 10'u32 == 10'i64
  107. # assert 10'u64 == 10'i8
  108. # assert 10'u64 == 10'i16
  109. # assert 10'u64 == 10'i32
  110. # assert 10'u64 == 10'i64