Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / tm / memopt-10.c
blob5438ecbd9cad2acf0d49be5d6a79641906363ad9
1 /* { dg-do compile } */
2 /* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
4 extern int something(void) __attribute__((transaction_safe));
5 extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
7 int f()
9 int *p;
11 p = malloc (sizeof (*p) * 100);
13 __transaction_atomic {
14 /* p[5] is thread private, but not transaction local since the
15 malloc is outside of the transaction. We can use the logging
16 functions for this. */
17 p[5] = 123;
19 if (something())
20 __transaction_cancel;
22 return p[5];
25 /* { dg-final { scan-tree-dump-times "ITM_LU" 0 "tmmark" } } */
26 /* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */
27 /* { dg-final { scan-tree-dump-times "int tm_save" 1 "tmmark" } } */