diff options
Diffstat (limited to 'gdb/testsuite/gdb.cp/casts.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/casts.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/casts.cc b/gdb/testsuite/gdb.cp/casts.cc index 6ecd340..543db89 100644 --- a/gdb/testsuite/gdb.cp/casts.cc +++ b/gdb/testsuite/gdb.cp/casts.cc @@ -10,6 +10,30 @@ struct B: public A B (int aa, int bb): A (aa), b(bb) {} }; + +struct Alpha +{ + virtual void x() { } +}; + +struct Gamma +{ +}; + +struct Derived : public Alpha +{ +}; + +struct VirtuallyDerived : public virtual Alpha +{ +}; + +struct DoublyDerived : public VirtuallyDerived, + public virtual Alpha, + public Gamma +{ +}; + int main (int argc, char **argv) { @@ -18,5 +42,11 @@ main (int argc, char **argv) A &ar = *b; B &br = (B&)ar; + Derived derived; + DoublyDerived doublyderived; + + Alpha *ad = &derived; + Alpha *add = &doublyderived; + return 0; /* breakpoint spot: casts.exp: 1 */ } |