OpenCores
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 774

Go to most recent revision | 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();
  }
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.