summaryrefslogtreecommitdiff
path: root/src/test/lib/tests/test_oddments.sail
blob: 4c8fd086329a5e6a828afc416f841c50383b99f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function unit test () = {
  (* XXX this is weird, wrong type?
  test_assert("is_one0", not(is_one(bitzero)));
  test_assert("is_one1", is_one(bitone)); *)

  test_assert("signed-1", signed(0xf) == -1);
  test_assert("signed0",  signed(0x0) == 0);
  test_assert("signed1",  signed(0x1) == 1);

  test_assert("unsigned-1", unsigned(0xf) == 15);
  test_assert("unsigned0",  unsigned(0x0) == 0);
  test_assert("unsigned1",  unsigned(0x1) == 1);
}