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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [rtti/] [dyncast4.C] - Diff between revs 301 and 338

Only display areas with differences | Details | Blame | View Log

Rev 301 Rev 338
// Test to make sure that we keep searching if we don't find the type we
// Test to make sure that we keep searching if we don't find the type we
// want at the expected address.
// want at the expected address.
// { dg-do run }
// { dg-do run }
struct A
struct A
{
{
  virtual void f() {};
  virtual void f() {};
};
};
struct B: A { };
struct B: A { };
struct C: A { };
struct C: A { };
struct D: B, C { };
struct D: B, C { };
int main()
int main()
{
{
  D d;
  D d;
  A* ap = static_cast(&d);
  A* ap = static_cast(&d);
  C* cp = dynamic_cast(ap);
  C* cp = dynamic_cast(ap);
  if (cp == 0)
  if (cp == 0)
    return 1;
    return 1;
  else
  else
    return 0;
    return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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