URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// Check that destructors are run after cleanup functions.
|
// Check that destructors are run after cleanup functions.
|
// { dg-do run }
|
// { dg-do run }
|
|
|
extern "C" void abort ();
|
extern "C" void abort ();
|
|
|
int i;
|
int i;
|
|
|
struct S {
|
struct S {
|
~S() {
|
~S() {
|
if (i != 1)
|
if (i != 1)
|
abort ();
|
abort ();
|
i = 2;
|
i = 2;
|
}
|
}
|
};
|
};
|
|
|
void f(void *) {
|
void f(void *) {
|
if (i != 0)
|
if (i != 0)
|
abort ();
|
abort ();
|
i = 1;
|
i = 1;
|
}
|
}
|
|
|
int main () {
|
int main () {
|
{
|
{
|
S s __attribute__((cleanup (f)));
|
S s __attribute__((cleanup (f)));
|
}
|
}
|
if (i != 2)
|
if (i != 2)
|
abort ();
|
abort ();
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.