aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/userdef.exp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2005-03-08 14:35:20 +0000
committerNathan Sidwell <nathan@codesourcery.com>2005-03-08 14:35:20 +0000
commit36e9969cac95317f057b47509cf63271bccd98b0 (patch)
treeb8c229973ba4500194f9b95686edd5d45fef1e89 /gdb/testsuite/gdb.cp/userdef.exp
parent3de11b2ef2c380882c4dcf3fa980b9817d229b04 (diff)
downloadgdb-36e9969cac95317f057b47509cf63271bccd98b0.zip
gdb-36e9969cac95317f057b47509cf63271bccd98b0.tar.gz
gdb-36e9969cac95317f057b47509cf63271bccd98b0.tar.bz2
* ax-gdb.c (gen_expr): Add UNOP_PLUS case.
* c-exp.y (exp): Add unary plus. * eval.c (evaluate_subexp_standard): Add UNOP_PLUS case. * valarith.c (value_x_unop): Add UNOP_PLUS case. (value_pos): New. * value.h (value_pos): Declare. * gdb.cp/userdef.cc (A1::operator+): New unary plus. (A2): New class. (main): Test operator+. * gdb.cp/userdef.exp: Test unary plus. Use A2::operator+ for breakpoint test.
Diffstat (limited to 'gdb/testsuite/gdb.cp/userdef.exp')
-rw-r--r--gdb/testsuite/gdb.cp/userdef.exp6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.cp/userdef.exp b/gdb/testsuite/gdb.cp/userdef.exp
index 5c9c933..86e901d 100644
--- a/gdb/testsuite/gdb.cp/userdef.exp
+++ b/gdb/testsuite/gdb.cp/userdef.exp
@@ -121,6 +121,8 @@ gdb_test "print one >> 31" "\\\$\[0-9\]* = {x = 0, y = 0}"
gdb_test "print !one" "\\\$\[0-9\]* = 0\[\r\n\]"
# Assumes 2's complement. So does everything...
+gdb_test "print +one" "\\\$\[0-9\]* = {x = 2, y = 3}"
+
gdb_test "print ~one" "\\\$\[0-9\]* = {x = -3, y = -4}"
gdb_test "print -one" "\\\$\[0-9\]* = {x = -2, y = -3}"
@@ -138,8 +140,8 @@ gdb_test "print one += 7" "\\\$\[0-9\]* = {x = 9, y = 10}"
gdb_test "print two = one" "\\\$\[0-9\]* = {x = 9, y = 10}"
# Check that GDB tolerates whitespace in operator names.
-gdb_test "break A1::'operator+'" ".*Breakpoint $decimal at.*"
-gdb_test "break A1::'operator +'" ".*Breakpoint $decimal at.*"
+gdb_test "break A2::'operator+'" ".*Breakpoint $decimal at.*"
+gdb_test "break A2::'operator +'" ".*Breakpoint $decimal at.*"
gdb_exit
return 0