summaryrefslogtreecommitdiff
path: root/src/test/lib/tests/test_lt.sail
blob: 6ae7a3c31989908a9a5e3dd96a66c656e4ff5a97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function unit test() = {
  test_assert("lt0", not( 1 < -1));
  test_assert("lt1", not(-1 < -1));
  test_assert("lt2",    (-1 <  1));

  (* XXX default is signed -- document this! *)
  test_assert("lt_vec0", not(0x1 < 0xf));
  test_assert("lt_vec1", not(0xf < 0xf));
  test_assert("lt_vec2",    (0xf < 0x1));

  test_assert("lt_vec_range0", not(0x1 < -1));
  test_assert("lt_vec_range1", not(0xf < -1));
  test_assert("lt_vec_range2",    (0xf < 1));
  (* NB missing range_vec version *)

  (* XXX missing implementations
  test_assert("lt_unsigned0", not( 1 <_u -1));
  test_assert("lt_unsigned1", not(-1 <_u -1));
  test_assert("lt_unsigned2",    (-1 <_u  1)); *)

  test_assert("lt_vec_unsigned0",    (0x1 <_u 0xf));
  test_assert("lt_vec_unsigned1", not(0xf <_u 0xf));
  test_assert("lt_vec_unsigned2", not(0xf <_u 0x1));

  (* NB there is no lt_vec_range unsigned or signed *)

  (* XXX missing implementations 
  test_assert("lt_signed0", not( 1 <_s -1));
  test_assert("lt_signed1", not(-1 <_s -1));
  test_assert("lt_signed2",    (-1 <_s  1)); *)

  test_assert("lt_vec_signed0", not(0x1 <_s 0xf));
  test_assert("lt_vec_signed1", not(0xf <_s 0xf));
  test_assert("lt_vec_signed2",    (0xf <_s 0x1));
}