summaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2001-12-07 21:58:19 +0000
committerDaniel Jacobowitz <dan@debian.org>2001-12-07 21:58:19 +0000
commit3b8997e1e753546bfe862f9e4e1fe5c41a7d0079 (patch)
treed71e3b40049f11998ede7a9d9d23ddbbe1ef8be9 /gdb/testsuite
parent7615ce326a5a2bf57473a5c9d5ff77eb1859b46c (diff)
downloadgdb-3b8997e1e753546bfe862f9e4e1fe5c41a7d0079.tar.gz
* gdb.c++/classes.exp: Add test for static member function.
* gdb.c++/misc.cc: Add class with static member function.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.c++/classes.exp16
-rw-r--r--gdb/testsuite/gdb.c++/misc.cc8
3 files changed, 29 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 2d30b1b8b79..7c6d03fcee6 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.c++/classes.exp: Add test for static member function.
+ * gdb.c++/misc.cc: Add class with static member function.
+
2001-12-07 Jim Blandy <jimb@redhat.com>
If GDB says it can't find the struct the function returned, report
diff --git a/gdb/testsuite/gdb.c++/classes.exp b/gdb/testsuite/gdb.c++/classes.exp
index 5b559d728d6..68142eb4a25 100644
--- a/gdb/testsuite/gdb.c++/classes.exp
+++ b/gdb/testsuite/gdb.c++/classes.exp
@@ -308,6 +308,22 @@ proc test_ptype_class_objects {} {
}
}
+ # With g++ 2.x and stabs debug info, we misinterpret static methods
+ # whose name matches their argument mangling.
+ send_gdb "ptype class Static\n"
+ gdb_expect {
+ -re "type = (class|struct) Static \{(${ws}public:|)${ws}Static & operator=\\(Static const ?&\\);${ws}Static\\(Static const ?&\\);${ws}Static\\((void|)\\);${ws}static void ii\\(int, int\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class Static"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class Static"
+ }
+ timeout {
+ fail "ptype class Static (timeout)"
+ return
+ }
+ }
+
send_gdb "ptype class vA\n"
gdb_expect {
-re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;${ws}vA & operator=\\(vA const &\\);${ws}vA\\(vA const &\\);${ws}vA\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.c++/misc.cc b/gdb/testsuite/gdb.c++/misc.cc
index caa54511838..286c02bc6df 100644
--- a/gdb/testsuite/gdb.c++/misc.cc
+++ b/gdb/testsuite/gdb.c++/misc.cc
@@ -269,6 +269,14 @@ void inheritance1 (void)
inheritance2 ();
}
+// ======================== static member functions =====================
+
+class Static {
+public:
+ static void ii(int, int);
+};
+void Static::ii (int, int) { }
+
// ======================== virtual base classes=========================
class vA {