From 9feb788b7f30fbe9e4654be22daede9924f20603 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 21 May 2021 07:20:31 -0700 Subject: match: binary-integer conv tests for #x-8000... * tests/016/arith.tl: Test providing coverage for the most negative two's complement integer, #x-800...00 in various sizes. The 64 bit cases are failing. --- tests/016/arith.tl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/016/arith.tl') diff --git a/tests/016/arith.tl b/tests/016/arith.tl index 1609833f..43efb6bb 100644 --- a/tests/016/arith.tl +++ b/tests/016/arith.tl @@ -121,3 +121,24 @@ #xAABBCCDDEE) (test (ffi-get #b'000000AABBCCDDEE' (ffi be-int64)) #xAABBCCDDEE) + +(test (mequal (ffi-put #x-8000 (ffi int16)) + #b'0080' + #b'8000') t) + +(test (ffi-get (ffi-put #x-8000 (ffi int16)) (ffi int16)) + #x-8000) + +(test (mequal (ffi-put #x-80000000 (ffi int32)) + #b'00000080' + #b'80000000') t) + +(test (ffi-get (ffi-put #x-80000000 (ffi int32)) (ffi int32)) + #x-80000000) + +(test (mequal (ffi-put #x-8000000000000000 (ffi int64)) + #b'0000000000000080' + #b'8000000000000000') t) + +(test (ffi-get (ffi-put #x-8000000000000000 (ffi int64)) (ffi int64)) + #x-8000000000000000) -- cgit v1.2.3