aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tm/20100519.c
blob: 009b7901a39db32bac8865c973187e983b4294b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-fgnu-tm -O" } */

typedef struct coordinate {
    double x;
} coordinate_t;

coordinate_t elementPtrC[3];

__attribute__((transaction_safe))
void TMelement_alloc (coordinate_t* coordinates, int numCoordinate)
{
   int i;
   for (i = 0; i < numCoordinate; i++) {
      elementPtrC[i] = coordinates[i];
   }
}