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 384 |
// { dg-do run }
|
// { dg-do run }
|
// GROUPS passed copy-ctors
|
// GROUPS passed copy-ctors
|
/*
|
/*
|
The old g++ output is
|
The old g++ output is
|
|
|
Item()
|
Item()
|
Compound()
|
Compound()
|
Pre foo
|
Pre foo
|
foo
|
foo
|
~Compound()
|
~Compound()
|
~Item()
|
~Item()
|
Post foo
|
Post foo
|
~Compound()
|
~Compound()
|
~Item()
|
~Item()
|
|
|
The output should be something like (produced from ATT 2.1)
|
The output should be something like (produced from ATT 2.1)
|
|
|
Item()
|
Item()
|
Compound()
|
Compound()
|
Pre foo
|
Pre foo
|
Item(const Item& i) <------ missing above
|
Item(const Item& i) <------ missing above
|
foo
|
foo
|
~Compound()
|
~Compound()
|
~Item()
|
~Item()
|
Post foo
|
Post foo
|
~Compound()
|
~Compound()
|
~Item()
|
~Item()
|
|
|
*/
|
*/
|
|
|
extern "C" int printf (const char *, ...);
|
extern "C" int printf (const char *, ...);
|
extern "C" void exit (int);
|
extern "C" void exit (int);
|
|
|
int count = 0;
|
int count = 0;
|
|
|
void
|
void
|
die (int x)
|
die (int x)
|
{
|
{
|
if (x != ++count)
|
if (x != ++count)
|
{
|
{
|
printf ("FAIL\n");
|
printf ("FAIL\n");
|
exit (1);
|
exit (1);
|
}
|
}
|
}
|
}
|
|
|
|
|
class Item {
|
class Item {
|
public:
|
public:
|
Item() { die (1); }
|
Item() { die (1); }
|
Item(const Item& i) { die (4); }
|
Item(const Item& i) { die (4); }
|
~Item() { count++; if (count != 7 && count != 10) die (-1); }
|
~Item() { count++; if (count != 7 && count != 10) die (-1); }
|
};
|
};
|
|
|
|
|
class Compound {
|
class Compound {
|
Item i;
|
Item i;
|
public:
|
public:
|
Compound() { die (2); }
|
Compound() { die (2); }
|
~Compound() { count++; if (count != 6 && count != 9) die (-1); }
|
~Compound() { count++; if (count != 6 && count != 9) die (-1); }
|
};
|
};
|
|
|
|
|
void foo(Compound a)
|
void foo(Compound a)
|
{
|
{
|
die (5);
|
die (5);
|
}
|
}
|
|
|
int
|
int
|
main()
|
main()
|
{
|
{
|
Compound a;
|
Compound a;
|
|
|
die (3);
|
die (3);
|
foo(a);
|
foo(a);
|
|
|
die (8);
|
die (8);
|
|
|
printf ("PASS\n");
|
printf ("PASS\n");
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.