aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tm/nested-1.c
blob: afadb83c1833d8c52d432463213d15db6c293b5a (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;
  }
}