aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-1.c
blob: c5ac5ced56c7bcc842baccbd14e516d00f0b3c56 (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
27
28
29
/* { dg-do compile } */
/* { dg-options "-fgnu-tm -O -fdump-tree-tmmemopt" } */

long g, xxx, yyy;
extern george() __attribute__((transaction_safe));
extern ringo(long int) __attribute__((transaction_safe));
int i;

f()
{
  __transaction_relaxed {
    g = 666;
    george();
    if (i == 9)
      goto bye;
    xxx=8;
    yyy=9;
    for (i=0; i < 10; ++i)
      ringo(g);
  bye:
    ringo(g);
  }
}

/* { dg-final { scan-tree-dump-times "transforming: .*_ITM_RaWU\[248\] \\(&g\\);" 1 "tmmemopt" } } */
/* { dg-final { scan-tree-dump-times "transforming: .*_ITM_WaRU4 \\(&i," 1 "tmmemopt" } } */
/* { dg-final { scan-tree-dump-times "transforming: .*_ITM_RaWU4 \\(&i\\);" 1 "tmmemopt" } } */
/* { dg-final { scan-tree-dump-times "transforming: .*_ITM_WaWU4 \\(&i," 1 "tmmemopt" } } */
/* { dg-final { cleanup-tree-dump "tmmemopt" } } */