URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do assemble }
|
// { dg-do assemble }
|
//
|
//
|
// Copyright (C) 2001 Free Software Foundation, Inc.
|
// Copyright (C) 2001 Free Software Foundation, Inc.
|
// Contributed by Nathan Sidwell 25 Jul 2001
|
// Contributed by Nathan Sidwell 25 Jul 2001
|
|
|
// Origin: gustavo@geneura.ugr.es
|
// Origin: gustavo@geneura.ugr.es
|
// Bug 3624. Template instantiation of a reference type was not
|
// Bug 3624. Template instantiation of a reference type was not
|
// converted from reference when doing a call.
|
// converted from reference when doing a call.
|
|
|
#include
|
#include
|
|
|
using namespace std;
|
using namespace std;
|
|
|
template class eo: public A
|
template class eo: public A
|
{
|
{
|
public:
|
public:
|
eo()
|
eo()
|
{
|
{
|
cout << this->x << " " << this->y << " "
|
cout << this->x << " " << this->y << " "
|
<< c(*this) << " "
|
<< c(*this) << " "
|
<< ((d)?"true":"false") << endl;
|
<< ((d)?"true":"false") << endl;
|
}
|
}
|
|
|
private:
|
private:
|
B b;
|
B b;
|
};
|
};
|
|
|
struct XY
|
struct XY
|
{
|
{
|
float x, y;
|
float x, y;
|
|
|
XY(): x(1), y(0.1) {}
|
XY(): x(1), y(0.1) {}
|
};
|
};
|
|
|
float fitness(const XY& a)
|
float fitness(const XY& a)
|
{
|
{
|
return a.x + a.y;
|
return a.x + a.y;
|
}
|
}
|
|
|
struct fitness2
|
struct fitness2
|
{
|
{
|
float operator()(const XY& a)
|
float operator()(const XY& a)
|
{
|
{
|
return a.x - a.y;
|
return a.x - a.y;
|
}
|
}
|
|
|
float f(const XY& a)
|
float f(const XY& a)
|
{
|
{
|
return a.x - a.y;
|
return a.x - a.y;
|
}
|
}
|
};
|
};
|
|
|
struct fitness3
|
struct fitness3
|
{
|
{
|
float operator()(const XY& a)
|
float operator()(const XY& a)
|
{
|
{
|
return a.x / a.y;
|
return a.x / a.y;
|
}
|
}
|
};
|
};
|
|
|
fitness2 f2;
|
fitness2 f2;
|
fitness3 f3;
|
fitness3 f3;
|
|
|
int main()
|
int main()
|
{
|
{
|
eo eo2;
|
eo eo2;
|
eo eo3;
|
eo eo3;
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.