view nocompile/delete_02.d @ 1622:d402aa53926c

Add test for bug 3092 written by Manuel K?nig
author Leandro Lucarella <llucax@gmail.com>
date Tue, 19 Oct 2010 19:18:23 -0300
parents 592f9ae41ba5
children
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @WARNING@ direct usage of Phobos's GC

// __DSTRESS_ELINE__ 26

module dstress.nocompile.delete_02;

import std.gc;

int status;

struct MyStruct{
	int i;

	delete(void* p){
		assert(status==0);
		status--;
	}
}

void test(){
	MyStruct t;
	delete t;
}

int main(){
	test();
	std.gc.fullCollect();
	std.gc.minimize();
	assert(status==-1);
	return 0;
}