From: H.J. Lu Date: Tue, 2 Dec 2014 12:47:29 +0000 (+0000) Subject: Add a test for PR ipa/63814 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=88936a2bfd6b33aa5fa3c01cbe973c362d4a06c2;p=gcc.git Add a test for PR ipa/63814 PR ipa/63814 * g++.dg/ipa/pr63814.C: New test. From-SVN: r218268 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a17cc6c298e..1410f10dacf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-02 H.J. Lu + + PR ipa/63814 + * g++.dg/ipa/pr63814.C: New test. + 2014-12-02 Wilco Dijkstra * 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 index 00000000000..15a7dda20b2 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr63814.C @@ -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); +}