URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// Test for proper handling of temporaries in ?: exprs.
|
// Test for proper handling of temporaries in ?: exprs.
|
|
|
extern "C" int printf (const char *, ...);
|
extern "C" int printf (const char *, ...);
|
int c = 0, d = 0;
|
int c = 0, d = 0;
|
|
|
class A {
|
class A {
|
public:
|
public:
|
A() { ++c; }
|
A() { ++c; }
|
A(const A&) { ++c; }
|
A(const A&) { ++c; }
|
~A() { ++d; }
|
~A() { ++d; }
|
};
|
};
|
|
|
A f (const A& a)
|
A f (const A& a)
|
{
|
{
|
return (c ? A() : A());
|
return (c ? A() : A());
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
{
|
{
|
f (c ? A() : A());
|
f (c ? A() : A());
|
}
|
}
|
printf ("%d %d\n", c, d);
|
printf ("%d %d\n", c, d);
|
return c != d || c != 2;
|
return c != d || c != 2;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.