OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [tm/] [nested-2.C] - Blame information for rev 715

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 -O" }
3
 
4
typedef unsigned long int uint64_t;
5
extern int *hash_indx;
6
 
7
typedef struct
8
{
9
  uint64_t exit_atomicsec_time;
10
} ent_ex_times;
11
class HashTree
12
{
13
public:
14
   __attribute__((transaction_safe))
15
   void *operator new(__SIZE_TYPE__);
16
   __attribute__((transaction_safe))
17
   int add_element();
18
private:
19
   HashTree **Hash_table;
20
   int Count;
21
};
22
 
23
 
24
__attribute__((transaction_safe))
25
int HashTree::add_element()
26
{
27
 ent_ex_times enter_exit_times_inside;
28
 int val = hash_indx[5];
29
 int tt;
30
 if (Hash_table[val] == __null)
31
 {
32
  __transaction_atomic {
33
    Hash_table[val] = new HashTree;
34
  }
35
 }
36
 __transaction_atomic {
37
 tt = Count++;
38
 enter_exit_times_inside.exit_atomicsec_time = 5;
39
 }
40
 return tt;
41
}

powered by: WebSVN 2.1.0

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