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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [expr/] [cast4.C] - Rev 754

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

// { dg-do run }
// PR c++/22132

extern "C" void abort ();

struct foo {
  int a;
  int b;
};

class Foobar : public foo {
public:
  Foobar() { a = 1; b = 2; }
  virtual ~Foobar() {}
};

Foobar obj;
const Foobar* objPtr = &obj;
foo* f = (foo*)objPtr;

int main () {
  if (f->a != 1 || f->b != 2)
    abort ();
}

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.