aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libvtv/testsuite/libvtv.cc/nested_vcall_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/libvtv/testsuite/libvtv.cc/nested_vcall_test.cc')
-rw-r--r--gcc-4.9/libvtv/testsuite/libvtv.cc/nested_vcall_test.cc77
1 files changed, 77 insertions, 0 deletions
diff --git a/gcc-4.9/libvtv/testsuite/libvtv.cc/nested_vcall_test.cc b/gcc-4.9/libvtv/testsuite/libvtv.cc/nested_vcall_test.cc
new file mode 100644
index 000000000..9d1a9c692
--- /dev/null
+++ b/gcc-4.9/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;
+}