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 |
// The VxWorks kernel has no implementation of atexit, so local statics
|
// The VxWorks kernel has no implementation of atexit, so local statics
|
// are never destroyed.
|
// are never destroyed.
|
// { dg-do run { xfail vxworks_kernel } }
|
// { dg-do run { xfail vxworks_kernel } }
|
// This is a poor test case, it is meant to ensure that function local
|
// This is a poor test case, it is meant to ensure that function local
|
// statics are destroyed at the right time. See PR 2736 for details.
|
// statics are destroyed at the right time. See PR 2736 for details.
|
// prms-id: 2736
|
// prms-id: 2736
|
|
|
#include
|
#include
|
|
|
int count;
|
int count;
|
|
|
struct A {
|
struct A {
|
int which;
|
int which;
|
A(int i) :which(i) {
|
A(int i) :which(i) {
|
// printf("ctor %x\n", this);
|
// printf("ctor %x\n", this);
|
}
|
}
|
~A() {
|
~A() {
|
// printf("dtor %x\n", this);
|
// printf("dtor %x\n", this);
|
if (++count != which)
|
if (++count != which)
|
abort ();
|
abort ();
|
}
|
}
|
};
|
};
|
|
|
void
|
void
|
foo() {
|
foo() {
|
static A a(1);
|
static A a(1);
|
}
|
}
|
|
|
A a(2);
|
A a(2);
|
|
|
int main() {
|
int main() {
|
foo();
|
foo();
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.