aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2009-11-10 22:17:06 +0000
committerKeith Seitz <keiths@redhat.com>2009-11-10 22:17:06 +0000
commit85feb311d32bf996c4da799a89be375b31d1b3e7 (patch)
tree77d2b3e1d4a41fef84da6a40812fa66be8d7d826 /gdb/testsuite
parentde64a9acc6e85d469fd1402da8e85310f0610f0d (diff)
downloadgdb-85feb311d32bf996c4da799a89be375b31d1b3e7.zip
gdb-85feb311d32bf996c4da799a89be375b31d1b3e7.tar.gz
gdb-85feb311d32bf996c4da799a89be375b31d1b3e7.tar.bz2
* gdb.cp/overload.exp: Add tests for resolving overloaded
methods in expression parsing/evaluation.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.cp/overload.exp21
2 files changed, 26 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f00932a..f17187d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-09 Keith Seitz <keiths@redhat.com>
+
+ * gdb.cp/overload.exp: Add tests for resolving overloaded
+ methods in expression parsing/evaluation.
+
2009-11-10 Daniel Jacobowitz <dan@codesourcery.com>
* lib/gdb.exp (default_gdb_version): Use --version instead of
diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp
index 24025a2..deab2f0 100644
--- a/gdb/testsuite/gdb.cp/overload.exp
+++ b/gdb/testsuite/gdb.cp/overload.exp
@@ -312,3 +312,24 @@ gdb_test "print overloadNamespace(dummyInstance)" ".\[0-9\]* = 2" "print overloa
# I wonder what this is for?
gdb_test "print intToChar(1)" "\\$\[0-9\]+ = 297"
+
+# Test expression evaluation with overloaded methods
+gdb_test "print foo::overload1arg" \
+ "non-unique member `overload1arg' requires type instantiation" \
+ "print foo::overload1arg"
+
+gdb_test "print foo::overload1arg(char***)" \
+ "no member function matches that type instantiation" \
+ "print foo::overload1arg(char***)"
+
+gdb_test "print foo::overload1arg(void)" \
+ "\\$$decimal = {int \\(foo \\* const\\)} $hex <foo::overload1arg\\(\\)>" \
+ "print foo::overload1arg(void)"
+
+foreach t [list char "signed char" "unsigned char" "short" \
+ "unsigned short" int "unsigned int" long "unsigned long" \
+ float double] {
+ gdb_test "print foo::overload1arg($t)" \
+ "\\$$decimal = {int \\(foo \\* const, $t\\)} $hex <foo::overload1arg\\($t\\)>" \
+ "print foo::overload1arg($t)"
+}