2 // GROUPS passed destructors
3 // Check that when an object of a derived class is (implicitly)
4 // destructed (on exit from the block in which it is declared)
5 // that the destructor for the base class also gets executed.
7 // (also check that this execution doesn't seg-fault)
9 extern "C" int printf (const char *, ...);
11 int derived_destructed;
19 base_data_member = 0x5e5e;
23 base_destructed = 0x781f;
27 struct derived : public base {
28 int derived_data_member;
32 derived_data_member = 0xe5e5;
36 derived_destructed = 0xf178;
46 if ((base_destructed != 0x781f) || (derived_destructed != 0xf178))
47 { printf ("FAIL\n"); return 1; }
54 derived derived_object;
56 derived_object.derived_data_member = 99;