From: David B. Robins Date: Mon, 20 Jun 2016 20:02:03 +0000 (+0000) Subject: re PR target/71571 ([CRIS] Multiple inheritance non-virtual PIC thunk causes crash) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3947cf1919a959ad8e2a3f09b42c604c5553a6c4;p=gcc.git re PR target/71571 ([CRIS] Multiple inheritance non-virtual PIC thunk causes crash) PR target/71571 * g++.dg/torture/pr71571.C: New test. From-SVN: r237616 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d2963c3fe4a..96b664d39a5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-20 David B. Robins + + PR target/71571 + * g++.dg/torture/pr71571.C: New test. + 2016-06-20 Jakub Jelinek PR target/71559 diff --git a/gcc/testsuite/g++.dg/torture/pr71571.C b/gcc/testsuite/g++.dg/torture/pr71571.C new file mode 100755 index 00000000000..e60edcd3c9b --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr71571.C @@ -0,0 +1,43 @@ +// { dg-do run } +// { dg-options "-fno-inline" { target { ! fpic } } } +// { dg-options "-fpic -fno-inline" { target fpic } } + +class XBase +{ +public: + virtual void FuncA() = 0; +}; + +class Y +{ +protected: + virtual void FuncB() {} +}; + +class X1 : public Y, public XBase +{ +public: + void FuncA() {} +}; + +class X2 : public XBase +{ +public: + X2(XBase &xb) : m_xb(xb) { } + void FuncA() + { + m_xb.FuncA(); + } + +private: + XBase &m_xb; +}; + + +int main() +{ + X1 x1; + X2 x2(x1); + XBase *pxb = &x2; + pxb->FuncA(); +}