about summary refs log tree commit diff stats
path: root/test/expression/simplifications.py
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2015-11-13 17:25:37 +0100
committerAjax <commial@gmail.com>2015-11-16 09:22:29 +0100
commitc488c7780ada00daa5b1ca8a27a585abfacd2905 (patch)
tree962b1b37ae1450fdfb6ef7fc9075e024c4583d08 /test/expression/simplifications.py
parent3eed941e88361f811496311014079c172e058a68 (diff)
downloadfocaccia-miasm-c488c7780ada00daa5b1ca8a27a585abfacd2905.tar.gz
focaccia-miasm-c488c7780ada00daa5b1ca8a27a585abfacd2905.zip
Simplifications: add cst_propagation for >>>/<<< c_rez
Diffstat (limited to 'test/expression/simplifications.py')
-rw-r--r--test/expression/simplifications.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/expression/simplifications.py b/test/expression/simplifications.py
index 60609df4..7b68c1bf 100644
--- a/test/expression/simplifications.py
+++ b/test/expression/simplifications.py
@@ -18,8 +18,10 @@ f = ExprId('f', size=64)
 m = ExprMem(a)
 s = a[:8]
 
+i0 = ExprInt(uint32(0x0))
 i1 = ExprInt(uint32(0x1))
 i2 = ExprInt(uint32(0x2))
+icustom = ExprInt(uint32(0x12345678))
 cc = ExprCond(a, b, c)
 
 o = ExprCompose([(a[:8], 8, 16),
@@ -301,6 +303,18 @@ to_test = [(ExprInt32(1) - ExprInt32(1), ExprInt32(0)),
     (expr_cmps(ExprInt32(-10), ExprInt32(-5)),
      ExprInt1(0)),
 
+    (ExprOp("<<<c_rez", i1, i0, i0),
+     i1),
+    (ExprOp("<<<c_rez", i1, i1, i0),
+     ExprInt32(2)),
+    (ExprOp("<<<c_rez", i1, i1, i1),
+     ExprInt32(3)),
+    (ExprOp(">>>c_rez", icustom, i0, i0),
+     icustom),
+    (ExprOp(">>>c_rez", icustom, i1, i0),
+     ExprInt32(0x91A2B3C)),
+    (ExprOp(">>>c_rez", icustom, i1, i1),
+     ExprInt32(0x891A2B3C)),
 ]
 
 for e, e_check in to_test[:]: