URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 384 |
// Test whether dwarf2 debug info works with named return value optimization
|
// Test whether dwarf2 debug info works with named return value optimization
|
// { dg-do compile }
|
// { dg-do compile }
|
|
|
struct S
|
struct S
|
{
|
{
|
virtual ~S();
|
virtual ~S();
|
S (const char *str);
|
S (const char *str);
|
S& operator= (const char *str);
|
S& operator= (const char *str);
|
operator const char *() const;
|
operator const char *() const;
|
S& operator+= (const char *str);
|
S& operator+= (const char *str);
|
};
|
};
|
inline S operator+ (const char *s1, const S &s2)
|
inline S operator+ (const char *s1, const S &s2)
|
{
|
{
|
S x (s1);
|
S x (s1);
|
x += s2;
|
x += s2;
|
return x;
|
return x;
|
}
|
}
|
struct U
|
struct U
|
{
|
{
|
U ();
|
U ();
|
U& operator= (const char *);
|
U& operator= (const char *);
|
const char *foo() const;
|
const char *foo() const;
|
operator const char *() const { return foo(); }
|
operator const char *() const { return foo(); }
|
};
|
};
|
template struct V
|
template struct V
|
{
|
{
|
T v;
|
T v;
|
};
|
};
|
template struct W
|
template struct W
|
{
|
{
|
V *w;
|
V *w;
|
W() : w (0) {}
|
W() : w (0) {}
|
const T& operator* () const { return w->v; }
|
const T& operator* () const { return w->v; }
|
T& operator* () { return w->v; }
|
T& operator* () { return w->v; }
|
};
|
};
|
struct X {
|
struct X {
|
X();
|
X();
|
};
|
};
|
struct Y {
|
struct Y {
|
Y (const U &u);
|
Y (const U &u);
|
};
|
};
|
X::X()
|
X::X()
|
{
|
{
|
W a;
|
W a;
|
U b;
|
U b;
|
b = (*a) + "xx";
|
b = (*a) + "xx";
|
Y c (b);
|
Y c (b);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.