Files
mercury/tests/hard_coded/from_int_int32.exp
Julien Fischer 2f39008fbf Add tests of int -> {int32,uint32} conversion.
Fix a bug in int -> uint32 conversion for the C grades.

tests/Mmakefile:
tests/hard_coded/from_int_int32.{m,exp}:
tests/hard_coded/from_int_uint32.m:
     Add the above tests.

tests/hard_coded/from_int_uint32.exp:
     Expected output for machines with a 64-bit int type.

tests/hard_coded/from_int_uint32.exp2:
     Expected output for machines with a 32-bit int type.

library/uint32.m:
     Fix a bug in the definition of from_int/2.  On machines where Mercury has
     a 64-bit int type the conversion should succeed for inputs up to (and
     including) UINT32_MAX.
2017-09-13 00:53:17 -04:00

17 lines
442 B
Plaintext

from_int(-9223372036854775808) = <<out-of-range>>
from_int(-2147483649) = <<out-of-range>>
from_int(-2147483648) = -2147483648
from_int(-32768) = -32768
from_int(-128) = -128
from_int(0) = 0
from_int(1) = 1
from_int(2) = 2
from_int(8) = 8
from_int(10) = 10
from_int(16) = 16
from_int(127) = 127
from_int(32767) = 32767
from_int(2147483647) = 2147483647
from_int(2147483648) = <<out-of-range>>
from_int(9223372036854775807) = <<out-of-range>>