URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// PR c++/3948
|
// PR c++/3948
|
// Test that the destructor call for a value parameter gets the
|
// Test that the destructor call for a value parameter gets the
|
// right address.
|
// right address.
|
|
|
// { dg-do run }
|
// { dg-do run }
|
|
|
void *p[2];
|
void *p[2];
|
int i;
|
int i;
|
int r;
|
int r;
|
|
|
struct C
|
struct C
|
{
|
{
|
int m;
|
int m;
|
|
|
C() { p[i++] = this; }
|
C() { p[i++] = this; }
|
~C() { if (p[--i] != this) r = 1; }
|
~C() { if (p[--i] != this) r = 1; }
|
};
|
};
|
|
|
|
|
void Foo (C c)
|
void Foo (C c)
|
{
|
{
|
p[i++] = &c;
|
p[i++] = &c;
|
}
|
}
|
|
|
int main ()
|
int main ()
|
{
|
{
|
C c;
|
C c;
|
|
|
Foo (c);
|
Foo (c);
|
return r;
|
return r;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.