Files
mercury/tests/hard_coded/pack_int32.exp
Zoltan Somogyi d3fd088aea Pack args using unsigned arithmetic.
compiler/ml_unify_gen.m:
    Do ORs and shifts on argument values being packed using MR_Unsigned.
    Cast the results to MR_Box explicitly.

compiler/ml_util.m:
    Add utility functions that return (static terms containing) the MLDS
    representations of the builtin integer types.

compiler/mlds_to_c_data.m:
    Parenthesize values being cast, to ensure that the cast applies
    to the *whole* of the value, not just an initial part. (For example,
    "(uint32_t) x >> 32" casts just x, not the result of the shift.)

tests/hard_coded/pack_int32.{m,exp}:
    A regression test for the bug report that this diff addresses.

tests/hard_coded/Mmakefile:
    Add the new test case.
2018-05-16 15:50:25 +02:00

4 lines
141 B
Plaintext

struct(-2147483648, 2147483647, -32768, 32767)
struct(-2147483648, 2147483647, -32768, 32767)
struct(-2147483648, 2147483647, -32768, 32767)