2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / lto / 20091004-2_0.C
blob40ef136514b9cd809271056d32c217f3f9f47c9d
1 // { dg-lto-do link }
2 // { dg-require-effective-target fpic }
3 // { dg-lto-options {{-fPIC -O -flto -Wno-return-type}} }
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;
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     }
24 class SLUFactor  {
25     DVector vec;
26     void solveRight (Vector& x, const Vector& b);
28 void SLUFactor::solveRight (Vector& x, const Vector& b) {
29     vec = b;