OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [abi/] [vbase15.C] - Rev 749

Go to most recent revision | Compare with Previous | Blame | View Log

 // { dg-do run }

struct Spec

{
 virtual int id () const = 0;
};
class D1_1_Spec :  public virtual Spec { };
class D1_2_Spec :  public virtual Spec { };
class D1_3_Spec :  public virtual Spec { };
class D2_1_Spec : public D1_1_Spec, public D1_2_Spec { };
class D2_Spec : public virtual D2_1_Spec, public virtual D1_3_Spec { };

struct D3_Spec : public D2_Spec
{
 virtual int id () const { return 3; }

};

__attribute__((noinline)) void foo(D3_Spec* spec)
{
  spec->id();
}

int main()
{
 D3_Spec spec;
 foo(&spec);
 return 0;
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.