aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-function.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.python/py-function.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-function.exp13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-function.exp b/gdb/testsuite/gdb.python/py-function.exp
index 7feca2b..30fde7d 100644
--- a/gdb/testsuite/gdb.python/py-function.exp
+++ b/gdb/testsuite/gdb.python/py-function.exp
@@ -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 ||"