diff options
Diffstat (limited to 'libvtv/testsuite/libvtv.cc/nested_vcall_test.cc')
-rw-r--r-- | libvtv/testsuite/libvtv.cc/nested_vcall_test.cc | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/libvtv/testsuite/libvtv.cc/nested_vcall_test.cc b/libvtv/testsuite/libvtv.cc/nested_vcall_test.cc new file mode 100644 index 00000000000..9d1a9c692da --- /dev/null +++ b/libvtv/testsuite/libvtv.cc/nested_vcall_test.cc @@ -0,0 +1,77 @@ +// { dg-do run } + +class EtherCtrl { + protected: + int ssap; + + public: + EtherCtrl(void); + ~EtherCtrl(); + virtual int getSsap(void) const; + virtual void setSsap(int); +}; + +class EtherFrameWithLLC { + protected: + int ssap; + + public: + EtherFrameWithLLC(const char *, int); + ~EtherFrameWithLLC(); + virtual int getSsap(void) const; + virtual void setSsap(int); +}; + + +EtherCtrl::EtherCtrl() +{ + this->ssap = 0; +} + +EtherCtrl::~EtherCtrl() +{ +} + +int EtherCtrl::getSsap() const +{ + return ssap; +} + +void EtherCtrl::setSsap(int ssap) +{ + this->ssap = ssap; +} + +EtherFrameWithLLC::EtherFrameWithLLC(const char *name, int kind) +{ + this->ssap = 0; +} + +EtherFrameWithLLC::~EtherFrameWithLLC() +{ +} + +int EtherFrameWithLLC::getSsap() const +{ + return ssap; +} + +void EtherFrameWithLLC::setSsap(int ssap) +{ + this->ssap = ssap; +} + + +int +main (int argc, char **argv) +{ + EtherCtrl *etherctrl = new EtherCtrl (); + EtherFrameWithLLC *frame = new EtherFrameWithLLC ("test", 10); + int my_value; + + etherctrl->setSsap(43); + frame->setSsap(etherctrl->getSsap()); + my_value = frame->getSsap(); + + return 0; +} |