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] - Rev 801

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

// { dg-lto-do link }
// { dg-require-effective-target fpic }
// { dg-lto-options {{-fPIC -O -flto}} }

typedef double Real;
class Vector {
    int dimen;
    Real* val;
public:
    Vector& operator=(const Vector& vec);
    Vector(int p_dimen, Real *p_val)
        : dimen(p_dimen), val(p_val)    { }
    int dim() const;
};
class DVector : public Vector {
public:
    void reDim(int newdim);
    explicit DVector(const Vector& old);
    DVector& operator=(const Vector& vec)    {
        reDim(vec.dim());
        Vector::operator=(vec);
    }
};
Vector& Vector::operator=(const Vector& vec)
{
  dimen = vec.dimen;
  val = vec.val;
}
int Vector::dim() const { return dimen; }
DVector::DVector(const Vector& old) : Vector(0, 0)
{
  *this = old;
}
void DVector::reDim(int newdim) {}
int main() {}

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.