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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [lto/] [20091004-1_0.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-lto-do link }
2
// { dg-require-effective-target fpic }
3
// { dg-lto-options {{-fPIC -O -flto}} }
4
 
5
typedef double Real;
6
class Vector {
7
    int dimen;
8
    Real* val;
9
public:
10
    Vector& operator=(const Vector& vec);
11
    Vector(int p_dimen, Real *p_val)
12
        : dimen(p_dimen), val(p_val)    { }
13
    int dim() const;
14
};
15
class DVector : public Vector {
16
public:
17
    void reDim(int newdim);
18
    explicit DVector(const Vector& old);
19
    DVector& operator=(const Vector& vec)    {
20
        reDim(vec.dim());
21
        Vector::operator=(vec);
22
    }
23
};
24
Vector& Vector::operator=(const Vector& vec)
25
{
26
  dimen = vec.dimen;
27
  val = vec.val;
28
}
29
int Vector::dim() const { return dimen; }
30
DVector::DVector(const Vector& old) : Vector(0, 0)
31
{
32
  *this = old;
33
}
34
void DVector::reDim(int newdim) {}
35
int main() {}
36
 

powered by: WebSVN 2.1.0

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