* auto-profile.c (afdo_annotate_cfg): Use update_max_bb_count.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / dtors1.C
blobcb5aa280e8d7fd6a2854f1c69723067f59a9780e
1 // { dg-do run  }
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.
6 //
7 // (also check that this execution doesn't seg-fault)
9 extern "C" int printf (const char *, ...); 
11 int derived_destructed;
12 int base_destructed;
14 struct base {
15   int base_data_member;
17   base()
18   {
19     base_data_member = 0x5e5e;
20   }
21   ~base()
22   {
23     base_destructed = 0x781f;
24   }
27 struct derived : public base {
28   int derived_data_member;
30   derived()
31   {
32     derived_data_member = 0xe5e5;
33   }
34   ~derived()
35   {
36     derived_destructed = 0xf178;
37   }
41 void test2 ();
43 int main ()
45         test2 ();
46         if ((base_destructed != 0x781f) || (derived_destructed != 0xf178))
47           { printf ("FAIL\n"); return 1; }
48         else
49           printf ("PASS\n");
52 void test2 ()
54         derived derived_object;
56         derived_object.derived_data_member = 99;