Add a test for PR ipa/63814
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 2 Dec 2014 12:47:29 +0000 (12:47 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 2 Dec 2014 12:47:29 +0000 (04:47 -0800)
PR ipa/63814
* g++.dg/ipa/pr63814.C: New test.

From-SVN: r218268

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

index a17cc6c298ee447d62cfc9262fe5f53ab2ae261f..1410f10dacf3766c4575f1ddb8085160c2a79328 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ipa/63814
+       * g++.dg/ipa/pr63814.C: New test.
+
 2014-12-02  Wilco Dijkstra  <wilco.dijkstra@arm.com>
 
        * gcc.target/aarch64/remat1.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/ipa/pr63814.C b/gcc/testsuite/g++.dg/ipa/pr63814.C
new file mode 100644 (file)
index 0000000..15a7dda
--- /dev/null
@@ -0,0 +1,29 @@
+// { dg-do run { target fpic } }
+// { dg-options "-O3 -fpic" }
+
+struct CBase {
+  virtual void BaseFunc () {}
+};
+
+struct MMixin {
+  virtual void * MixinFunc (int, int) = 0;
+};
+
+struct CExample: CBase, public MMixin
+{
+  void *MixinFunc (int arg, int arg2)
+  {
+    return this;
+  }
+};
+
+void *test (MMixin & anExample)
+{
+  return anExample.MixinFunc (0, 0);
+}
+
+int main ()
+{
+  CExample c;
+  return (test (c) != &c);
+}