devirt3.C: New test.
authorDehao Chen <dehao@google.com>
Thu, 24 Oct 2013 16:27:57 +0000 (16:27 +0000)
committerDehao Chen <dehao@gcc.gnu.org>
Thu, 24 Oct 2013 16:27:57 +0000 (16:27 +0000)
2013-10-24  Dehao Chen  <dehao@google.com>

* g++.dg/opt/devirt3.C: New test.

From-SVN: r204022

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/devirt3.C [new file with mode: 0644]

index 7283360..5694dcd 100644 (file)
@@ -1,3 +1,7 @@
+2013-10-24  Dehao Chen  <dehao@google.com>
+
+       * g++.dg/opt/devirt3.C: New test.
+
 2013-08-24  Tobias Burnus  <burnus@net-b.de>
 
        PR other/33426
diff --git a/gcc/testsuite/g++.dg/opt/devirt3.C b/gcc/testsuite/g++.dg/opt/devirt3.C
new file mode 100644 (file)
index 0000000..6738673
--- /dev/null
@@ -0,0 +1,24 @@
+// { dg-do compile }
+// { dg-options "-O2" }
+
+class ert_RefCounter {
+ protected:
+  int refCounterE;
+  virtual ~ert_RefCounter() {}
+};
+
+class ebs_Object : virtual public ert_RefCounter {
+};
+
+class dpr_App : public ebs_Object {
+ public:
+  virtual void run();
+};
+
+class dpr_Job : public ebs_Object {};
+
+void dpr_run(ebs_Object& objectA) {
+  ((dpr_App&)objectA).run();
+  dpr_Job jobL;
+  dpr_run(jobL);
+}