2 // { dg-options "-O2" }
5 // There should be exactly one temporary generated for the code in "f"
6 // below when optimizing -- for the result of "b + c". We have no
7 // easy way of checking that directly, so we count the number of calls
8 // to "memcpy", which is used on (some?) targets to copy temporaries.
9 // If there is more than two calls (one for coping "*this" to "t", and
10 // one for copying the temporary to "a"), then there are too many
16 void *memcpy (void *dest, const void *src, __SIZE_TYPE__ n)
18 char *d = (char *) dest;
19 const char *s = (const char *) src;
28 T &operator+=(T const &v) __attribute__((noinline));
29 T operator+(T const &v) const { T t = *this; t += v; return t; }
32 T &T::operator+=(T const &v) {
38 void f() { a = b + c; }