summaryrefslogtreecommitdiff
path: root/src/test/lib/tests/test_rightshift.sail
diff options
context:
space:
mode:
authorAlasdair Armstrong2017-07-26 14:12:09 +0100
committerAlasdair Armstrong2017-07-26 14:12:09 +0100
commit678ab0e23ba4a8d95010df2bd2467dae7d544e29 (patch)
tree0b2e02773327b9483f24b2e1ad46b7235ec9633e /src/test/lib/tests/test_rightshift.sail
parent26e59493cde0ffbf1868426fe3bec158f2dbaad0 (diff)
parent18cf235fad35a0e06e26ea91ee0e1c673febddb8 (diff)
Merge remote-tracking branch 'origin/master' into sail_new_tc
Diffstat (limited to 'src/test/lib/tests/test_rightshift.sail')
-rw-r--r--src/test/lib/tests/test_rightshift.sail10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/lib/tests/test_rightshift.sail b/src/test/lib/tests/test_rightshift.sail
new file mode 100644
index 00000000..7879a33e
--- /dev/null
+++ b/src/test/lib/tests/test_rightshift.sail
@@ -0,0 +1,10 @@
+function unit test () = {
+ test_assert ("rightshift_small0", (0x99 >> 0) == 0x99);
+ test_assert ("rightshift_small3", (0x99 >> 3) == 0x13);
+ test_assert ("rightshift_small7", (0x99 >> 7) == 0x01);
+ test_assert ("rightshift_small8", (0x99 >> 8) == 0x00); (* XXX fails on interp *)
+ test_assert ("rightshift_big0", (0x99999999999999999 >> 0) == 0x99999999999999999);
+ test_assert ("rightshift_big3", (0x99999999999999999 >> 3) == 0x13333333333333333);
+ test_assert ("rightshift_big7", (0x99999999999999999 >> 7) == 0x01333333333333333);
+ test_assert ("rightshift_big68", (0x99999999999999999 >> 68) == 0x00000000000000000); (* XXX fails on interp *)
+}