blob: 563474eaf686ec8b2b187dfd49d5aecfda9f1400 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
/* { dg-do compile } */
/* { dg-options "-fgnu-tm" } */
extern void baz(int);
int y;
void foo(volatile int x)
{
__transaction_atomic {
x = 5; /* { dg-error "invalid use of volatile lvalue inside transaction" } */
x += y;
y++;
}
baz(x);
}
volatile int i = 0;
void george()
{
__transaction_atomic {
if (i == 2) /* { dg-error "invalid use of volatile lvalue inside transaction" } */
i = 1;
}
}
|