summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tm/nested-1.c
blob: cf500d1fc64ec68f75daab535933c28560f7dd52 (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
/* { dg-do compile } */
/* { dg-options "-fgnu-tm" } */

extern int foo(int) __attribute__((transaction_safe));
void bar(void)
{
  __transaction_atomic {
    if (foo(1))
      __transaction_atomic {
        if (foo(2))
          __transaction_atomic {
            if (foo(3))
              __transaction_atomic {
                if (foo(4))
                  foo(5);
                else
                  __transaction_cancel;
              }
            else
              __transaction_cancel;
          }
        else
          __transaction_cancel;
      }
    else
      __transaction_cancel;
  }
}