about summary refs log tree commit diff stats
path: root/test/expression/simplifications.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2015-02-12 15:24:19 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2015-02-13 13:26:27 +0100
commit2a969bbd61ce3d5f74fdf6f577322993fcb527fb (patch)
tree2641783cbe1e54429273be5e63473612f3ff9042 /test/expression/simplifications.py
parent35b5007249fcc55e4b0a49b60145a07bc620c04b (diff)
downloadfocaccia-miasm-2a969bbd61ce3d5f74fdf6f577322993fcb527fb.tar.gz
focaccia-miasm-2a969bbd61ce3d5f74fdf6f577322993fcb527fb.zip
Test/Simplification: add regression tests
Diffstat (limited to 'test/expression/simplifications.py')
-rw-r--r--test/expression/simplifications.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/expression/simplifications.py b/test/expression/simplifications.py
index b6d7e462..f4b4fcd6 100644
--- a/test/expression/simplifications.py
+++ b/test/expression/simplifications.py
@@ -12,6 +12,7 @@ b = ExprId('b')
 c = ExprId('c')
 d = ExprId('d')
 e = ExprId('e')
+f = ExprId('f', size=64)
 
 m = ExprMem(a)
 s = a[:8]
@@ -190,6 +191,13 @@ to_test = [(ExprInt32(1) - ExprInt32(1), ExprInt32(0)),
     (ExprCompose([(a, 0, 32), (b, 32, 64)]) << ExprInt64(0x10),
      ExprCompose([(ExprInt16(0), 0, 16), (a, 16, 48), (b[:16], 48, 64)])),
 
+    (ExprCompose([(a, 0, 32), (b, 32, 64)]) | ExprCompose([(c, 0, 32), (d, 32, 64)]),
+     ExprCompose([(a|c, 0, 32), (b|d, 32, 64)])),
+    (ExprCompose([(a, 0, 32), (ExprInt32(0), 32, 64)]) | ExprCompose([(ExprInt32(0), 0, 32), (d, 32, 64)]),
+     ExprCompose([(a, 0, 32), (d, 32, 64)])),
+    (ExprCompose([(f[:32], 0, 32), (ExprInt32(0), 32, 64)]) | ExprCompose([(ExprInt32(0), 0, 32), (f[32:], 32, 64)]),
+     f),
+
 ]
 
 for e, e_check in to_test[:]: