URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do assemble }
|
// { dg-do assemble }
|
// { dg-options "-O3" }
|
// { dg-options "-O3" }
|
// Origin: Mark Mitchell
|
// Origin: Mark Mitchell
|
|
|
class ostream;
|
class ostream;
|
|
|
struct S
|
struct S
|
{
|
{
|
virtual void print(ostream&) const = 0;
|
virtual void print(ostream&) const = 0;
|
};
|
};
|
|
|
template
|
template
|
class vector
|
class vector
|
{
|
{
|
public:
|
public:
|
_Tp& operator[](unsigned __n) const { return *(_M_start + __n); }
|
_Tp& operator[](unsigned __n) const { return *(_M_start + __n); }
|
_Tp* _M_start;
|
_Tp* _M_start;
|
};
|
};
|
|
|
class T
|
class T
|
{
|
{
|
public:
|
public:
|
|
|
void print(ostream&) const;
|
void print(ostream&) const;
|
|
|
vector bcList_m;
|
vector bcList_m;
|
};
|
};
|
|
|
void T::print(ostream& o) const
|
void T::print(ostream& o) const
|
{
|
{
|
int n = 3;
|
int n = 3;
|
|
|
for (int i = 0; i < n; ++i)
|
for (int i = 0; i < n; ++i)
|
bcList_m[i]->print(o);
|
bcList_m[i]->print(o);
|
return;
|
return;
|
}
|
}
|
|
|
ostream&
|
ostream&
|
operator<<(ostream& o, const T& bcList)
|
operator<<(ostream& o, const T& bcList)
|
{
|
{
|
bcList.print(o);
|
bcList.print(o);
|
return o;
|
return o;
|
}
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.