#include <stdio.h>
#include <assert.h>
#include <unistd.h>

static int saw_ctor;
static int saw_dtor;
static int done_main;

struct test_class {
  test_class () { 
    m = new char[10];
    printf("In ctor\n");
    saw_ctor = 1;
  }
  ~test_class () {
    delete m;
    printf("In dtor\n");
    assert(done_main);
    saw_dtor = 1;
    _exit(0);
  }
  char * m;
} g;

int main()
{
	printf("In main\n");
	assert(saw_ctor == 1);
	assert(saw_dtor == 0);
	done_main = 1;
	return 1;
}
