diff options
author | Michael Chastain <mec@google.com> | 2003-08-23 03:55:59 +0000 |
---|---|---|
committer | Michael Chastain <mec@google.com> | 2003-08-23 03:55:59 +0000 |
commit | 1105b7eff4c333814e2f260a4ff3df45057a78a4 (patch) | |
tree | 7cf20e2e8c5617c7de559da699df9c0b3dc813ae /gdb/testsuite/gdb.cp/derivation.cc | |
parent | dd21ace235665bd33a51862fe2293c43224c0e59 (diff) | |
download | fsf-binutils-gdb-1105b7eff4c333814e2f260a4ff3df45057a78a4.zip fsf-binutils-gdb-1105b7eff4c333814e2f260a4ff3df45057a78a4.tar.gz fsf-binutils-gdb-1105b7eff4c333814e2f260a4ff3df45057a78a4.tar.bz2 |
2003-08-22 Michael Chastain <mec@shout.net>
* gdb.cp: New directory.
* gdb.cp/*: Copy from gdb.c++/*.
* gdb.c++/*: Remove.
* Makefile.in: Change gdb.c++ to gdb.cp.
* configure.in: Ditto.
* configure: Regnerate.
Diffstat (limited to 'gdb/testsuite/gdb.cp/derivation.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/derivation.cc | 240 |
1 files changed, 240 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/derivation.cc b/gdb/testsuite/gdb.cp/derivation.cc new file mode 100644 index 0000000..f6d42e7 --- /dev/null +++ b/gdb/testsuite/gdb.cp/derivation.cc @@ -0,0 +1,240 @@ +class A { +public: + int a; + int aa; + + A() + { + a=1; + aa=2; + } + int afoo(); + int foo(); + +}; + + + +class B { +public: + int b; + int bb; + + B() + { + b=3; + bb=4; + } + int bfoo(); + int foo(); + +}; + + + +class C { +public: + int c; + int cc; + + C() + { + c=5; + cc=6; + } + int cfoo(); + int foo(); + +}; + + + +class D : private A, public B, protected C { +public: + int d; + int dd; + + D() + { + d =7; + dd=8; + } + int dfoo(); + int foo(); + +}; + + +class E : public A, B, protected C { +public: + int e; + int ee; + + E() + { + e =9; + ee=10; + } + int efoo(); + int foo(); + +}; + + +class F : A, public B, C { +public: + int f; + int ff; + + F() + { + f =11; + ff=12; + } + int ffoo(); + int foo(); + +}; + +class G : private A, public B, protected C { +public: + int g; + int gg; + int a; + int b; + int c; + + G() + { + g =13; + gg =14; + a=15; + b=16; + c=17; + + } + int gfoo(); + int foo(); + +}; + + + + +int A::afoo() { + return 1; +} + +int B::bfoo() { + return 2; +} + +int C::cfoo() { + return 3; +} + +int D::dfoo() { + return 4; +} + +int E::efoo() { + return 5; +} + +int F::ffoo() { + return 6; +} + +int G::gfoo() { + return 77; +} + +int A::foo() +{ + return 7; + +} + +int B::foo() +{ + return 8; + +} + +int C::foo() +{ + return 9; + +} + +int D::foo() +{ + return 10; + +} + +int E::foo() +{ + return 11; + +} + +int F::foo() +{ + return 12; + +} + +int G::foo() +{ + return 13; + +} + + +void marker1() +{ +} + + +int main(void) +{ + + A a_instance; + B b_instance; + C c_instance; + D d_instance; + E e_instance; + F f_instance; + G g_instance; + + #ifdef usestubs + set_debug_traps(); + breakpoint(); + #endif + + + marker1(); // marker1-returns-here + + a_instance.a = 20; // marker1-returns-here + a_instance.aa = 21; + b_instance.b = 22; + b_instance.bb = 23; + c_instance.c = 24; + c_instance.cc = 25; + d_instance.d = 26; + d_instance.dd = 27; + e_instance.e = 28; + e_instance.ee =29; + f_instance.f =30; + f_instance.ff =31; + + + + + return 0; + +} + + + |