Import pre-release gcc-5.0 to new vendor branch
[dragonfly.git] / contrib / gcc-5.0 / libitm / testsuite / libitm.c / stackundo.c
1 static int __attribute__((noinline)) test2(int x[1000])
2 {
3   int i;
4   return x[12];
5 }
6
7 static int __attribute__((noinline)) test1()
8 {
9   int x[1000], i;
10
11   for (i = 0; i < 1000; i++)
12     x[i] = i;
13   return test2(x);
14 }
15
16 int main()
17 {
18   __transaction_atomic {
19     if (test1() !=0)
20       __transaction_cancel;
21   }
22   return 0;
23 }