diff options
Diffstat (limited to 'libitm/testsuite/libitm.c/stackundo.c')
-rw-r--r-- | libitm/testsuite/libitm.c/stackundo.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libitm/testsuite/libitm.c/stackundo.c b/libitm/testsuite/libitm.c/stackundo.c new file mode 100644 index 0000000..02759d7 --- /dev/null +++ b/libitm/testsuite/libitm.c/stackundo.c @@ -0,0 +1,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; +} |