From 2a969bbd61ce3d5f74fdf6f577322993fcb527fb Mon Sep 17 00:00:00 2001 From: Fabrice Desclaux Date: Thu, 12 Feb 2015 15:24:19 +0100 Subject: Test/Simplification: add regression tests --- test/expression/simplifications.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') 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[:]: -- cgit 1.4.1