[Lldb-commits] [PATCH] D67227: [lldb] Extend and document TestIRInterpreter.py

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 6 10:17:07 PDT 2019


shafik added inline comments.


================
Comment at: lldb/packages/Python/lldbsuite/test/commands/expression/ir-interpreter/TestIRInterpreter.py:48
+            self.type = type
+            self.decl_expr = type + " " + self.name + " = " + str(self.value)
+            self.unsigned_type = "unsigned" in type
----------------
Maybe be worth noting here that for the unsigned case we are relying in the fact that converting an signed value to an unsigned value works as we would expect with twos complement numbers. 


================
Comment at: lldb/packages/Python/lldbsuite/test/commands/expression/ir-interpreter/TestIRInterpreter.py:110
+                variable_list.append(v)
+                interp_result = self.frame().EvaluateExpression(
+                    v.decl_expr, nojit_options).GetValueAsUnsigned()
----------------
You don't see to use `interp_result` here


================
Comment at: lldb/packages/Python/lldbsuite/test/commands/expression/ir-interpreter/TestIRInterpreter.py:126
+                    # to the expression. This will be shown when the test fails.
+                    expr += " // " + str(var1.value) + " " + op.name + " " + str(var2.value)
+                    exprs_to_run.append(expr)
----------------
In the unsigned case should we be converting the python value which is signed manually to an unsigned value via a mask like [it is discussed here](https://stackoverflow.com/q/20766813/1708801)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67227/new/

https://reviews.llvm.org/D67227





More information about the lldb-commits mailing list