diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2015-11-16 10:42:40 +0100 |
|---|---|---|
| committer | serpilliere <serpilliere@users.noreply.github.com> | 2015-11-16 10:42:40 +0100 |
| commit | 1f892fabed6300aeb592121af5b2137ac35c07f6 (patch) | |
| tree | 1ff49eb5b7fd59fcdbcd6602ba72764566113884 /test/expression/simplifications.py | |
| parent | 3eed941e88361f811496311014079c172e058a68 (diff) | |
| parent | 55a81cc899599ae24a4c5322a6d812a24e28a292 (diff) | |
| download | miasm-1f892fabed6300aeb592121af5b2137ac35c07f6.tar.gz miasm-1f892fabed6300aeb592121af5b2137ac35c07f6.zip | |
Merge pull request #273 from commial/fix-python-emul
Fix python emul
Diffstat (limited to 'test/expression/simplifications.py')
| -rw-r--r-- | test/expression/simplifications.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/expression/simplifications.py b/test/expression/simplifications.py index 60609df4..acef0904 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,23 @@ 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)), + (ExprOp("idiv", ExprInt16(0x0123), ExprInt16(0xfffb))[:8], + ExprInt8(0xc6)), + (ExprOp("imod", ExprInt16(0x0123), ExprInt16(0xfffb))[:8], + ExprInt8(0x01)), + ] for e, e_check in to_test[:]: |