diff mbox

Add testcase for PR 63894

Message ID 20141117092825.GB344@x4
State New
Headers show

Commit Message

Markus Trippelsdorf Nov. 17, 2014, 9:28 a.m. UTC
PR 63894 was fixed by r217634, so I'm just adding the testcase.

Tested on powerpc64-unknown-linux-gnu.
Commited.

2014-11-17  Markus Trippelsdorf  <markus@trippelsdorf.de>

  PR ipa/63894
  * g++.dg/ipa/pr63894.C: New test.
diff mbox

Patch

diff --git a/gcc/testsuite/g++.dg/ipa/pr63894.C b/gcc/testsuite/g++.dg/ipa/pr63894.C
new file mode 100644
index 000000000000..d0ba96bc5a38
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr63894.C
@@ -0,0 +1,46 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+struct A
+{
+  void *operator new(unsigned long, int);
+};
+class C
+{
+public:
+  C (int);
+};
+class D
+{
+public:
+  enum Type
+  {
+    BOX
+  };
+  D (int, Type, C);
+};
+class F
+{
+public:
+  virtual void m_fn1 (int, D);
+};
+class G : public F, public A
+{
+};
+class K : public G
+{
+public:
+  K (C, D);
+};
+class J
+{
+  D m_fn2 (int);
+  bool m_fn3 (G *);
+};
+bool
+J::m_fn3 (G *p1)
+{
+  p1->m_fn1 (0, D (0, D::BOX, 0));
+  K *d = new (0) K (0, m_fn2 (0));
+  m_fn3 (d);
+}