summaryrefslogtreecommitdiff
path: root/src/test/lib/tests/test_div.sail
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-07-30 19:16:34 +0100
committerAlasdair Armstrong2018-08-01 16:42:33 +0100
commit1479ae359fd3afebf9c3dfb6e58a77254e8140ea (patch)
treeffcfd96409467a5c41009f68afe1f65a2c7a3d49 /src/test/lib/tests/test_div.sail
parent0b70a9d7464d6c30534d2f511cb8c9879c76b1e5 (diff)
Remove old test directory in src/test
Diffstat (limited to 'src/test/lib/tests/test_div.sail')
-rw-r--r--src/test/lib/tests/test_div.sail39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/test/lib/tests/test_div.sail b/src/test/lib/tests/test_div.sail
deleted file mode 100644
index 1af58d20..00000000
--- a/src/test/lib/tests/test_div.sail
+++ /dev/null
@@ -1,39 +0,0 @@
-function unit test () = {
- test_assert ("divpospos_exact", (21 div 7) == 3);
- test_assert ("divposneg_exact", (21 div -7) == -3);
- test_assert ("divnegpos_exact", (-21 div 7) == -3);
- test_assert ("divnegneg_exact", (-21 div -7) == 3);
-
- test_assert ("divpospos_approx", (21 div 8) == 2);
- test_assert ("divposneg_approx", (21 div -8) == -2);
- test_assert ("divnegpos_approx", (-21 div 8) == -2);
- test_assert ("divnegneg_approx", (-21 div -8) == 2);
-
- (* quot and div are synonyms but let's check... *)
- test_assert ("quotpospos_exact", (21 quot 7) == 3);
- test_assert ("quotposneg_exact", (21 quot -7) == -3);
- test_assert ("quotnegpos_exact", (-21 quot 7) == -3);
- test_assert ("quotnegneg_exact", (-21 quot -7) == 3);
-
- test_assert ("quotpospos_approx", (21 quot 8) == 2);
- test_assert ("quotposneg_approx", (21 quot -8) == -2);
- test_assert ("quotnegpos_approx", (-21 quot 8) == -2);
- test_assert ("quotnegneg_approx", (-21 quot -8) == 2);
-
- (* XXX currently crashes on shallow embedding
- test_assert ("div_overflow", ((bit[8])(0x80 quot_s 0xff)) == 0x80);
- *)
- test_assert ("quot_vec_pospos_exact", ((bit[8])(0x15 quot 0x07)) == 0x03);
- test_assert ("quot_vec_posneg_exact", ((bit[8])(0x15 quot 0xf9)) == 0x00);
- test_assert ("quot_vec_negpos_exact", ((bit[8])(0xeb quot 0x07)) == 0x21);
- test_assert ("quot_vec_negneg_exact", ((bit[8])(0xeb quot 0xf9)) == 0x00);
-
- test_assert ("quot_vec_pospos_approx", ((bit[8])(0x15 quot 0x08)) == 0x02);
- test_assert ("quot_vec_posneg_approx", ((bit[8])(0x15 quot 0xf8)) == 0x00);
- test_assert ("quot_vec_negpos_approx", ((bit[8])(0xeb quot 0x08)) == 0x1d);
- test_assert ("quot_vec_negneg_approx", ((bit[8])(0xeb quot 0xf8)) == 0x00);
-
- test_assert ("quot_overflow_vec", (((bit[8], bit, bit))(0x15 quot 0x08)) == (0x02, false, false));
- test_assert ("quot_overflow_vec", (((bit[8], bit, bit))(0x80 quot 0xff)) == (0x00, false, false));
-}
-