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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [lto/] [20080904_0.C] - Rev 318

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.