diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/inline11.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/inline11.C | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline11.C b/gcc/testsuite/g++.old-deja/g++.other/inline11.C new file mode 100644 index 000000000..56d803b64 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/inline11.C @@ -0,0 +1,34 @@ +// { dg-do assemble } +// { dg-options "-O2" } +// Origin: Jakub Jelinek <jakub@redhat.com> + +class baz +{ +public: + baz& operator += (const baz&); +}; + +inline baz& baz::operator += (const baz& r) +{ + return *this; +} + +inline baz operator + (int x, const baz& y) +{ + return y; +} + +static inline baz bar (int alpha); +static inline baz foo (int alpha) +{ + baz tmp = alpha + foo (alpha); + tmp += alpha + bar (alpha); + return tmp; +} + +static inline baz bar (int alpha) +{ + baz tmp = alpha + bar (alpha); + tmp += alpha + foo (alpha); + return tmp; +} |