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 }
|
// prms-id: 3579
|
// prms-id: 3579
|
|
|
extern "C" int printf(const char *, ...);
|
extern "C" int printf(const char *, ...);
|
|
|
int num_x;
|
int num_x;
|
|
|
class Y {
|
class Y {
|
public:
|
public:
|
Y () { printf("Y() this: %x\n", this); }
|
Y () { printf("Y() this: %x\n", this); }
|
~Y () { printf("~Y() this: %x\n", this); }
|
~Y () { printf("~Y() this: %x\n", this); }
|
};
|
};
|
|
|
class X {
|
class X {
|
public:
|
public:
|
X () {
|
X () {
|
++num_x;
|
++num_x;
|
printf("X() this: %x\n", this);
|
printf("X() this: %x\n", this);
|
Y y;
|
Y y;
|
*this = (X) y;
|
*this = (X) y;
|
}
|
}
|
|
|
X (const Y & yy) { printf("X(const Y&) this: %x\n", this); ++num_x; }
|
X (const Y & yy) { printf("X(const Y&) this: %x\n", this); ++num_x; }
|
X & operator = (const X & xx) {
|
X & operator = (const X & xx) {
|
printf("X.op=(X&) this: %x\n", this);
|
printf("X.op=(X&) this: %x\n", this);
|
return *this;
|
return *this;
|
}
|
}
|
|
|
~X () { printf("~X() this: %x\n", this); --num_x; }
|
~X () { printf("~X() this: %x\n", this); --num_x; }
|
};
|
};
|
|
|
int main (int, char **) {
|
int main (int, char **) {
|
{ X anX; }
|
{ X anX; }
|
if (num_x) {
|
if (num_x) {
|
printf("FAIL\n");
|
printf("FAIL\n");
|
return 1;
|
return 1;
|
}
|
}
|
printf("PASS\n");
|
printf("PASS\n");
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.