view gcc/testsuite/gcc.dg/tm/pr46654.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { 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;
  }
}