diff options
Diffstat (limited to 'gdb/testsuite/gdb.cp')
-rw-r--r-- | gdb/testsuite/gdb.cp/rtti.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/rtti.h | 10 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/rtti1.cc | 20 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/rtti2.cc | 6 |
4 files changed, 38 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.cp/rtti.exp b/gdb/testsuite/gdb.cp/rtti.exp index 0a8a2d7..18f3cc2 100644 --- a/gdb/testsuite/gdb.cp/rtti.exp +++ b/gdb/testsuite/gdb.cp/rtti.exp @@ -140,5 +140,10 @@ gdb_continue_to_breakpoint "end of constructors in func" gdb_test "print *obj" "\\$\[0-9\]* = {<n2::Base2> = .*}" +gdb_breakpoint [gdb_get_line_number "func3-constructs-done"] +gdb_continue_to_breakpoint "end of constructors in func3" + +gdb_test "print *obj3" "\\$\[0-9\]* = {<n2::C2> = .*}" + gdb_exit return 0 diff --git a/gdb/testsuite/gdb.cp/rtti.h b/gdb/testsuite/gdb.cp/rtti.h index 879896d..c324925 100644 --- a/gdb/testsuite/gdb.cp/rtti.h +++ b/gdb/testsuite/gdb.cp/rtti.h @@ -1,6 +1,6 @@ /* Code to go along with tests in rtti.exp. - Copyright 2003 Free Software Foundation, Inc. + Copyright 2003, 2004 Free Software Foundation, Inc. Contributed by David Carlton <carlton@bactrian.org> and by Kealia, Inc. @@ -45,4 +45,12 @@ namespace n2 { }; extern C2 *create2(); + + namespace n3 { + class C3 : public C2 { + public: + }; + } + + extern n3::C3 *create3(); } diff --git a/gdb/testsuite/gdb.cp/rtti1.cc b/gdb/testsuite/gdb.cp/rtti1.cc index de8e12f..d32ac04 100644 --- a/gdb/testsuite/gdb.cp/rtti1.cc +++ b/gdb/testsuite/gdb.cp/rtti1.cc @@ -63,16 +63,33 @@ void refer_to (n2::C2 *obj) // Do nothing. } +void refer_to (n2::n3::C3 *obj) +{ + // Do nothing. +} + namespace n2 { void func () { C2 *obj = create2 (); - refer_to (obj); // func-constructs-done + refer_to (obj); // func-constructs-done return; } + + namespace n3 + { + void func3 () + { + C3 *obj3 = create3 (); + + refer_to (obj3); // func3-constructs-done + + return; + } + } } int main() @@ -84,6 +101,7 @@ int main() C2 *e2 = create2(); n2::func(); // main-constructs-done + n2::n3::func3(); return 0; } diff --git a/gdb/testsuite/gdb.cp/rtti2.cc b/gdb/testsuite/gdb.cp/rtti2.cc index 8bb1ed6..353a1f8 100644 --- a/gdb/testsuite/gdb.cp/rtti2.cc +++ b/gdb/testsuite/gdb.cp/rtti2.cc @@ -1,6 +1,6 @@ /* Code to go along with tests in rtti.exp. - Copyright 2003 Free Software Foundation, Inc. + Copyright 2003, 2004 Free Software Foundation, Inc. Contributed by David Carlton <carlton@bactrian.org> and by Kealia, Inc. @@ -33,4 +33,8 @@ namespace n2 { return new D2(0, 0); } + n3::C3 *create3() { + return new n3::C3(); + } + } |