summaryrefslogtreecommitdiff
path: root/tools/regression/pthread/unwind/Test.cpp
blob: bad63be44798db25f2c53e7684d16b9251b2da48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

static int destructed;
static int destructed2;

class Test {
public:
	Test() { printf("Test::Test()\n"); }
	~Test() { printf("Test::~Test()\n"); destructed = 1; }
};

void
cleanup_handler(void *arg __unused)
{
	destructed2 = 1;
	printf("%s()\n", __func__);
}

void
check_destruct(void)
{
	if (!destructed)
		printf("Bug, object destructor is not called\n");
	else
		printf("OK\n");
}

void
check_destruct2(void)
{
	if (!destructed)
		printf("Bug, object destructor is not called\n");
	else if (!destructed2)
		printf("Bug, cleanup handler is not called\n");
	else
		printf("OK\n");
}