diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C new file mode 100644 index 000000000..a0fbb5f42 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +struct CBase { + virtual void BaseFunc () {} +}; + +struct MMixin { + virtual void * MixinFunc (int, void *) = 0; +}; + +struct CExample: CBase, public MMixin +{ + void *MixinFunc (int arg, void *arg2) + { + if (arg != 1 || arg2) + return 0; + return this; + } +}; + +void *test (MMixin & anExample) +{ + return anExample.MixinFunc (1, 0); +} + +int main () +{ + CExample c; + return (test (c) != &c); +} |