gdb
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-function.exp
index 7feca2b6aad75a7cb0e14c6e5903ed15d81bb178..30fde7dd41f26f5c37356b3bd8a3c8844fbef1d3 100644 (file)
@@ -77,3 +77,16 @@ gdb_py_test_multiple "input value-returning convenience function" \
   "end" ""
 
 gdb_test "print \$double (1)" "= 2" "call value-returning function"
+
+gdb_py_test_multiple "input int-returning function" \
+  "python" "" \
+  "class Yes(gdb.Function):" "" \
+  "    def __init__(self):" "" \
+  "        gdb.Function.__init__(self, 'yes')" "" \
+  "    def invoke(self):" "" \
+  "        return 1" "" \
+  "Yes ()" "" \
+  "end" ""
+
+gdb_test "print \$yes() && \$yes()" " = 1" "call yes with &&"
+gdb_test "print \$yes() || \$yes()" " = 1" "call yes with ||"
This page took 0.024903 seconds and 4 git commands to generate.