URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
|
|
struct ex;
|
struct ex;
|
struct basic {
|
struct basic {
|
int refcount;
|
int refcount;
|
ex eval() const;
|
ex eval() const;
|
basic() : refcount(0) {}
|
basic() : refcount(0) {}
|
};
|
};
|
|
|
struct ex {
|
struct ex {
|
basic *bp;
|
basic *bp;
|
ex() : bp(0) { }
|
ex() : bp(0) { }
|
ex(const basic &);
|
ex(const basic &);
|
virtual ~ex();
|
virtual ~ex();
|
void construct_from_basic(const basic &);
|
void construct_from_basic(const basic &);
|
};
|
};
|
|
|
ex basic::eval() const {
|
ex basic::eval() const {
|
throw 1;
|
throw 1;
|
}
|
}
|
|
|
inline ex::ex(const basic &b) { construct_from_basic (b); }
|
inline ex::ex(const basic &b) { construct_from_basic (b); }
|
inline ex::~ex() { if (--bp->refcount == 0) delete bp; }
|
inline ex::~ex() { if (--bp->refcount == 0) delete bp; }
|
void ex::construct_from_basic(const basic &b) {
|
void ex::construct_from_basic(const basic &b) {
|
const ex & tmpex = b.eval();
|
const ex & tmpex = b.eval();
|
bp = tmpex.bp;
|
bp = tmpex.bp;
|
bp->refcount++;
|
bp->refcount++;
|
}
|
}
|
|
|
ex pow() { return basic(); }
|
ex pow() { return basic(); }
|
|
|
int main()
|
int main()
|
{
|
{
|
try { pow (); } catch (int) {}
|
try { pow (); } catch (int) {}
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.