about summary refs log tree commit diff stats
path: root/test/core/sembuilder.py
blob: 1854fc5886f8d7250776b448ae70d6560cd0e832 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import inspect

from miasm2.core.sembuilder import SemBuilder
import miasm2.expression.expression as m2_expr

sb = SemBuilder(m2_expr.__dict__)

@sb.parse
def test(Arg1, Arg2, Arg3):
    "Test docstring"
    Arg1 = Arg2
    mem32[Arg1] = Arg2
    mem32[Arg2] = Arg3  + i32(4) - mem32[Arg1]
    Arg3 = Arg3 if Arg2 else i32(0)

a = m2_expr.ExprId('A')
b = m2_expr.ExprId('B')
c = m2_expr.ExprId('C')
ir = None
instr = None
print test(ir, instr, a, b, c)
print test.__doc__