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] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-lto-do run }
2
 
3
/* This test will fail to link if the vtable for Derived is not emitted.  */
4
 
5
class Base {
6
public:
7
  Base(char *buf, unsigned len)
8
    : _buf(buf),
9
      _len(len)
10
  {}
11
 
12
  virtual int length () { return _len; }
13
 
14
private:
15
  char * _buf;
16
  unsigned _len;
17
};
18
 
19
class Derived : public Base {
20
public:
21
  Derived(char *buf, unsigned len)
22
    : Base(buf, len),
23
      _ctr(len)
24
  {}
25
 
26
  virtual int length () { return _ctr; }
27
 
28
private:
29
  unsigned _ctr;
30
};
31
 
32
int main ()
33
{
34
  Derived *d = new Derived (new char[256], 256);
35
 
36
  return 0;
37
}

powered by: WebSVN 2.1.0

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