summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/class2.cc
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2015-02-26 17:31:29 -0800
committerDoug Evans <dje@google.com>2015-02-26 17:31:29 -0800
commit0def5aaad6a89e78f09cef2b95635dc3254ce304 (patch)
tree22dd04767ffb22e3eac010b00c86c03c682bdb6d /gdb/testsuite/gdb.cp/class2.cc
parent330b17b30f85b091a214c2987de5dfef1e9733ac (diff)
downloadbinutils-gdb-0def5aaad6a89e78f09cef2b95635dc3254ce304.tar.gz
Add missing CHECK_TYPEDEF calls to recent vptr_{fieldno,basetype} cleanup.
gdb/ChangeLog: * gdbtypes.c (internal_type_vptr_fieldno): Add missing call to CHECK_TYPEDEF. (set_type_vptr_fieldno): Ditto. (internal_type_vptr_basetype, set_type_vptr_basetype): Ditto. * gnu-v3-abi.c (gnuv3_dynamic_class): Ditto. gdb/testsuite/ChangeLog: * gdb.cp/class2.cc (Dbase, D): New classes. (main): New local delta. * gdb.cp/class2.exp: Test printing delta. * gdb.cp/classes.cc (DynamicBase2, DynamicBar): New classes. (dynbar): New global. * gdb.cp/classes.exp (test_ptype_class_objects): Test ptype DynamicBar.
Diffstat (limited to 'gdb/testsuite/gdb.cp/class2.cc')
-rw-r--r--gdb/testsuite/gdb.cp/class2.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/class2.cc b/gdb/testsuite/gdb.cp/class2.cc
index 617a8fa6bee..409fb29cd1e 100644
--- a/gdb/testsuite/gdb.cp/class2.cc
+++ b/gdb/testsuite/gdb.cp/class2.cc
@@ -46,6 +46,23 @@ struct C : public B
A *c2;
};
+/* Use a typedef for the baseclass, with a virtual method, to exercise
+ gnu-v3-abi.c:gnuv3_dynamic_class recursion. It's important that the
+ class itself have no name to make sure the typedef makes it through
+ to the recursive call. */
+typedef class {
+ public:
+ /* This class has no members as gcc 4.9.x doesn't emit the debug info
+ for them. */
+ virtual int get () { return 42; }
+} Dbase;
+
+class D : public Dbase
+{
+ public:
+ int d1;
+};
+
// Stop the compiler from optimizing away data.
void refer (A *)
{
@@ -65,12 +82,14 @@ int main (void)
A alpha, *aap, *abp, *acp;
B beta, *bbp;
C gamma;
+ D delta;
empty e;
A &aref (alpha);
alpha.a1 = 100;
beta.a1 = 200; beta.b1 = 201; beta.b2 = 202;
gamma.c1 = 0; gamma.c2 = (A *) ~0UL;
+ delta.d1 = 400;
aap = &alpha; refer (aap);
abp = &beta; refer (abp);