about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2017-01-14 12:27:22 +0100
committerGitHub <noreply@github.com>2017-01-14 12:27:22 +0100
commit35941c723827ab1d0e8b1fe86894cc188a869dcd (patch)
treeea8293629a6d05b13a4f429019afd5da2a616234 /test
parent97d25c6e584e48b4ff85e529da290db34847868e (diff)
parent50f6ca146c0b810982ad5b42eea84ee0b6d26f8a (diff)
downloadmiasm-35941c723827ab1d0e8b1fe86894cc188a869dcd.tar.gz
miasm-35941c723827ab1d0e8b1fe86894cc188a869dcd.zip
Merge pull request #477 from commial/fix/division
Fix/division
Diffstat (limited to '')
-rw-r--r--test/expression/modint.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/expression/modint.py b/test/expression/modint.py
index e7c19d0c..17c12907 100644
--- a/test/expression/modint.py
+++ b/test/expression/modint.py
@@ -8,7 +8,7 @@ d = uint1(0)
 e = uint1(1)
 
 f = uint8(0x1)
-
+g = int8(-3)
 
 print a, b, c
 print a + b, a + c, b + c
@@ -53,7 +53,20 @@ assert(f ^ f == 0)
 assert(f ^ 0 == f)
 assert(0 ^ f == f)
 assert(1 ^ f == 0)
+assert(c / g == -1)
+assert(c / -3 == -1)
+assert(c % g == 1)
+assert(c % -3 == 1)
 
 print e + c, c + e, c - e, e - c
 print 1000 * a
 print hex(a)
+
+define_int(128)
+define_uint(128)
+h = uint128(0x11223344556677889900AABBCCDDEEFF)
+i = int128(-0x9900AABBCCDDEEFF1122334455667788)
+
+assert(i / h == 6)
+assert(i % h == 0x3221aa32bb43cd58d9cc54dd65ee7e)
+