diff options
| author | Robert Norton | 2017-07-19 18:08:02 +0100 |
|---|---|---|
| committer | Robert Norton | 2017-07-19 18:08:02 +0100 |
| commit | 632b10c0d4b01dc1af8593b8ae1f088fbfd9e342 (patch) | |
| tree | ac566808213125670da5f4dc3d702fe663333f7e /src/test/lib/tests/test_gt.sail | |
| parent | d8969b1f9631dc15d5fb6b3b33a4a69dbfb7358a (diff) | |
split library tests into separate files to avoid risk of sail compiler stack overflow.
Diffstat (limited to 'src/test/lib/tests/test_gt.sail')
| -rw-r--r-- | src/test/lib/tests/test_gt.sail | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/test/lib/tests/test_gt.sail b/src/test/lib/tests/test_gt.sail new file mode 100644 index 00000000..8576a8cd --- /dev/null +++ b/src/test/lib/tests/test_gt.sail @@ -0,0 +1,36 @@ +function unit test() = { + test_assert("gt0", ( 1 > -1)); + test_assert("gt1", not(-1 > -1)); + test_assert("gt2", not(-1 > 1)); + + (* XXX default is signed -- document this! *) + test_assert("gt_vec0", (0x1 > 0xf)); + test_assert("gt_vec1", not(0xf > 0xf)); + test_assert("gt_vec2", not(0xf > 0x1)); + + test_assert("gt_vec_range0", (0x1 > -1)); + test_assert("gt_vec_range1", not(0xf > -1)); + test_assert("gt_vec_range2", not(0xf > 1)); + (* NB missing range_vec version *) + + (* XXX missing implementations + test_assert("gt_unsigned0", ( 1 >_u -1)); + test_assert("gt_unsigned1", not(-1 >_u -1)); + test_assert("gt_unsigned2", not(-1 >_u 1)); *) + + test_assert("gt_vec_unsigned0", not(0x1 >_u 0xf)); + test_assert("gt_vec_unsigned1", not(0xf >_u 0xf)); + test_assert("gt_vec_unsigned2", (0xf >_u 0x1)); + + (* NB there is no gt_vec_range unsigned or signed *) + + (* XXX missing implementations + test_assert("gt_signed0", ( 1 >_s -1)); + test_assert("gt_signed1", not(-1 >_s -1)); + test_assert("gt_signed2", not(-1 >_s 1)); *) + + test_assert("gt_vec_signed0", (0x1 >_s 0xf)); + test_assert("gt_vec_signed1", not(0xf >_s 0xf)); + test_assert("gt_vec_signed2", not(0xf >_s 0x1)); +} + |
