From 88936a2bfd6b33aa5fa3c01cbe973c362d4a06c2 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 2 Dec 2014 12:47:29 +0000 Subject: [PATCH] Add a test for PR ipa/63814 PR ipa/63814 * g++.dg/ipa/pr63814.C: New test. From-SVN: r218268 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/ipa/pr63814.C | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 gcc/testsuite/g++.dg/ipa/pr63814.C 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); +} -- 2.30.2