URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [tm/] [pr45940-2.C] - Rev 693
Compare with Previous | Blame | View Log
// { dg-do compile }
// { dg-options "-fgnu-tm -O1" }
__attribute__((transaction_pure))
inline int atomic_exchange_and_add(int dv )
{
int r;
__asm__ ("" : "=r"(r));
return r;
}
class sp_counted_base
{
public:
__attribute__((transaction_safe))
void release()
{
if( atomic_exchange_and_add(-1 ) == 1 )
{
}
}
};
sp_counted_base *base;
void here(){
__transaction_atomic {
base->release();
}
}