about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/core/sembuilder.py25
-rw-r--r--test/test_all.py1
2 files changed, 26 insertions, 0 deletions
diff --git a/test/core/sembuilder.py b/test/core/sembuilder.py
new file mode 100644
index 00000000..3c1b7d3f
--- /dev/null
+++ b/test/core/sembuilder.py
@@ -0,0 +1,25 @@
+import inspect
+from pdb import pm
+
+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)
+    tmpvar = i32(2)
+    Arg2 = tmpvar
+
+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__
diff --git a/test/test_all.py b/test/test_all.py
index 52f2238b..aefd0196 100644
--- a/test/test_all.py
+++ b/test/test_all.py
@@ -101,6 +101,7 @@ for script in ["interval.py",
                "graph.py",
                "parse_asm.py",
                "utils.py",
+               "sembuilder.py",
                ]:
     testset += RegressionTest([script], base_dir="core")
 ## Expression