aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tm/memopt-6.c
blob: 496ce2dd3e87d17958ec1a4af9db481df6a9e486 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-fgnu-tm -O -fdump-tree-tmedge --param tm-max-aggregate-size=1" } */

struct large { int x[100]; };
struct large bark();
extern int test (void) __attribute__((transaction_safe));
struct large lacopy;

int f()
{
  int i = readint();
  struct large lala = bark();
  __transaction_atomic {
    lala.x[55] = 666;
    lala = lacopy;		/* Aggregate instrumentation.  */
  }
  return lala.x[i];
}

/* { dg-final { scan-tree-dump-times "memmoveRtWt \\\(&lala, &lacopy" 1 "tmedge" } } */
/* { dg-final { cleanup-tree-dump "tmedge" } } */