URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// GROUPS passed copy-ctors
|
// GROUPS passed copy-ctors
|
#include
|
#include
|
|
|
int pass = 0;
|
int pass = 0;
|
class name {
|
class name {
|
int namestuff;
|
int namestuff;
|
public:
|
public:
|
name() {
|
name() {
|
namestuff = 111;
|
namestuff = 111;
|
}
|
}
|
name(const name& subject);
|
name(const name& subject);
|
|
|
name & operator = (const name& right) {
|
name & operator = (const name& right) {
|
this->namestuff = right.namestuff;
|
this->namestuff = right.namestuff;
|
return *this;
|
return *this;
|
}
|
}
|
|
|
~name() {
|
~name() {
|
;
|
;
|
}
|
}
|
};
|
};
|
|
|
name::name(const name& subject) {
|
name::name(const name& subject) {
|
pass = 1;
|
pass = 1;
|
}
|
}
|
|
|
class person {
|
class person {
|
int personstuff;
|
int personstuff;
|
name personname;
|
name personname;
|
public:
|
public:
|
person() {
|
person() {
|
;
|
;
|
personstuff = 222;
|
personstuff = 222;
|
}
|
}
|
~person() {
|
~person() {
|
;
|
;
|
}
|
}
|
void print() {
|
void print() {
|
;
|
;
|
}
|
}
|
|
|
};
|
};
|
|
|
void
|
void
|
test(person argp)
|
test(person argp)
|
{
|
{
|
person testp;
|
person testp;
|
|
|
;
|
;
|
argp.print();
|
argp.print();
|
testp = argp;
|
testp = argp;
|
argp.print();
|
argp.print();
|
testp.print();
|
testp.print();
|
;
|
;
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
person mainp;
|
person mainp;
|
test(mainp);
|
test(mainp);
|
if (pass)
|
if (pass)
|
printf ("PASS\n");
|
printf ("PASS\n");
|
else
|
else
|
{ printf ("FAIL\n"); return 1; }
|
{ printf ("FAIL\n"); return 1; }
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.