| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */ |
| 3 |
|
| 4 |
/* Test that `nontrxn' doesn't end up inside the transaction. */ |
| 5 |
|
| 6 |
typedef struct node { |
| 7 |
int * val; |
| 8 |
struct node *next; |
| 9 |
} node_t; |
| 10 |
|
| 11 |
node_t *next; |
| 12 |
int nontrxn1, nontrxn; |
| 13 |
|
| 14 |
static int set_remove(int * val) |
| 15 |
{ |
| 16 |
int result; |
| 17 |
int * v; |
| 18 |
__transaction_relaxed { |
| 19 |
v = next->val; |
| 20 |
result = (v == val); |
| 21 |
if (result) |
| 22 |
result = 2; |
| 23 |
} |
| 24 |
return result; |
| 25 |
} |
| 26 |
|
| 27 |
void test(void *data) |
| 28 |
{ |
| 29 |
extern void bark(void); |
| 30 |
if (set_remove(0)) |
| 31 |
bark(); |
| 32 |
nontrxn = 99; /* Should be outside transaction. */ |
| 33 |
} |
| 34 |
|
| 35 |
/* { dg-final { scan-tree-dump-times "_ITM_W.*nontrxn" 0 "tmmark" } } */ |