* auto-profile.c (afdo_annotate_cfg): Use update_max_bb_count.
[official-gcc.git] / gcc / testsuite / g++.dg / abi / covariant4.C
blob942b1686e8a4b9b5566a231c6ccb99ecb14fcd47
1 // { dg-do run  }
3 // Copyright (C) 2005 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 11 Feb 2005 <nathan@codesourcery.com>
6 // Origin: bredelin@ucla.edu
7 // Bug 19891: Incorrect covariant vtables
9 struct Model {
10   bool full_tree;
11   virtual Model* clone() const =0;
12   virtual const char *name() const =0;
13   virtual ~Model() {}
16 struct R: virtual public Model {
17   virtual R* clone() const =0;
19 struct A: virtual public Model {
20   virtual A* clone() const=0;
22 struct RA: public R, public A {
23   virtual RA* clone() const=0;
26 static const char *string = "EQU";
28 struct EQU: public RA {
29   virtual EQU* clone() const {return new EQU(*this);}
30   const char *name() const {return string;}
33 int main() {
34   Model* M1 = new EQU();
35   Model* M2 = M1->clone();
36   Model* M3 = M2->clone();
38   if (M1->name () != string)
39     return 1;
40   if (M2->name () != string)
41     return 2;
42   if (M3->name () != string)
43     return 3;
44   
45   return 0;