stackundo.c 308 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
int __attribute__((noinline)) test2(int x[1000])
{
  int i;
  return x[12];
}

int __attribute__((noinline)) test1()
{
  int x[1000], i;

  for (i = 0; i < 1000; i++)
    x[i] = i;
  return test2(x);
}

int main()
{
  __transaction_atomic {
    if (test1() !=0)
      __transaction_cancel;
  }
  return 0;
}