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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [lto/] [20080904_0.C] - Rev 749

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

// { dg-lto-do run }

/* This test will fail to link if the vtable for Derived is not emitted.  */

class Base {
public:
  Base(char *buf, unsigned len)
    : _buf(buf),
      _len(len)
  {}

  virtual int length () { return _len; }

private:
  char * _buf;
  unsigned _len;
};

class Derived : public Base {
public:
  Derived(char *buf, unsigned len)
    : Base(buf, len),
      _ctr(len)
  {}

  virtual int length () { return _ctr; }

private:
  unsigned _ctr;
};

int main ()
{
  Derived *d = new Derived (new char[256], 256);

  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.