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] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-fgnu-tm -O1" }
3
 
4
__attribute__((transaction_pure))
5
inline int atomic_exchange_and_add(int dv )
6
{
7
    int r;
8
    __asm__ ("" : "=r"(r));
9
    return r;
10
}
11
 
12
class sp_counted_base
13
{
14
public:
15
    __attribute__((transaction_safe))
16
    void release()
17
    {
18
        if( atomic_exchange_and_add(-1 ) == 1 )
19
        {
20
        }
21
    }
22
};
23
 
24
sp_counted_base *base;
25
 
26
void here(){
27
  __transaction_atomic {
28
    base->release();
29
  }
30
}

powered by: WebSVN 2.1.0

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