aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/class2.cc
diff options
context:
space:
mode:
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 617a8fa..409fb29 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 = α refer (aap);
abp = β refer (abp);